Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38052

    Hello,
    I’m using the PD4ML 4.0.19 demo version for testing purposes.
    While Korean characters are displayed correctly in regular HTML text, Korean text that requires bold treatment, such as within <h2> or tags, is not appearing in the generated PDF.
    Could you please let me know what might be wrong?
    I will attach the resulting PDF and here is my source code

    String doc = "<h2 style=\"border:1px solid #000\">ENG</h2>"+ "<h2 style=\"border:1px solid #000\">한글</h2>"+ "그냥 한글 텍스트\n"+ "<p style=\"font-weight: bold;\">bold eng, bold 한글</p>"; ByteArrayInputStream bais = new ByteArrayInputStream(doc.getBytes("UTF-8")); PD4ML pd4ml = new PD4ML(); pd4ml.useTTF("java:fonts", true); pd4ml.enableLigatures(true); pd4ml.setPageSize(PageSize.A4); pd4ml.setPageMargins(new PageMargins(top, right, left, bottom)); pd4ml.readHTML(bais); File pdf = new File("test.pdf"); FileOutputStream fos = new FileOutputStream(pdf); pd4ml.writePDF(fos);

    #38053

    Hello,
    I’m using the PD4ML 4.0.19 demo version for testing purposes.
    While Korean characters are displayed correctly in regular HTML text, Korean text that requires bold treatment, such as within <h2> or tags, is not appearing in the generated PDF.
    Could you please let me know what might be wrong?
    I will attach the resulting PDF and here is my source code
    String doc = "<h2 style=\"border:1px solid #000\">ENG</h2>"+ "<h2 style=\"border:1px solid #000\">한글</h2>"+ "그냥 한글 텍스트\n"+ "<p style=\"font-weight: bold;\">bold eng, bold 한글</p>"; ByteArrayInputStream bais = new ByteArrayInputStream(doc.getBytes("UTF-8")); PD4ML pd4ml = new PD4ML(); pd4ml.useTTF("java:fonts", true); pd4ml.enableLigatures(true); pd4ml.setPageSize(PageSize.A4); pd4ml.setPageMargins(new PageMargins(top, right, left, bottom)); pd4ml.readHTML(bais); File pdf = new File("test.pdf"); FileOutputStream fos = new FileOutputStream(pdf); pd4ml.writePDF(fos);

    Attachments:
    You must be logged in to view attached files.
    #38055

    Most probably you can fix the issue by an explicit specifying of a font face:

    H2, BODY {font-family: Times New Roman, Batang, Serif}

    Please find attached a test document, which uses no Batang, but only Arial Unicode MS as a fallback font. Arial Unicode MS has no bold version (the same as Batang), and you can see PD4ML successfully synthesizes bold font weight

    Attachments:
    You must be logged in to view attached files.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.