HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Technical questions / Troubleshooting › Korean font is not being applied › Reply To: Korean font is not being applied
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);
