Multi Language Support in OpenPDF Java

147 views Asked by At

In OpenPDF if any of the text is with language other than English (Korean / Chinese) is showing as empty. I have tried with creating custom font by downloading the otf file from google fonts but no luck it only altered the font style not the Korean text.

If any of the text field is in multi language how to support the same while creating the PDF.

1

There are 1 answers

0
Asturio On

When using non latin letters you should always set a font, that support the characters you need. And also embed the font in you PDF.

Take a look in this example:

https://github.com/LibrePDF/OpenPDF/blob/master/pdf-toolbox/src/main/java/org/librepdf/openpdf/examples/fonts/languages/Chinese.java

or this one: https://github.com/LibrePDF/OpenPDF/blob/master/pdf-toolbox/src/test/java/com/lowagie/examples/fonts/getting/ChineseJapaneseKorean.java