I’m attempting to write text to a PDF in situations where I need to support multiple languages on a single PDF. This may include regular latin characters as well as CJK characters. I’ve tried many attempts to do this and have it load the character sets from the OS without much success. The farthest I have gotten is support latin characters, arabic, russian and I believe Vietnamese characters found on the embedded fonts example here https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFonts.java?view=markup
I’m doing a similar approach from the example but I believe I’m using the FileSystemFontProvider provided by the FontMappers class by doing something such as
TrueTypeFont ttf = FontMappers.instance().getTrueTypeFont("Arial", null).getFont();
PDFont font = PDType0Font.load(signatureDocument, ttf.getOriginalData());
As I mentioned I seem to be able to support the text in the EmbeddedFonts example but can’t seem to determine how I can also support CJK. When I try to print characters from chinese, japanese or korean it throws an IllegalArgumentException: No glyph for U+ in the font ArialMT.
I’m currently using 2.0.2 of PDFBox but could potentially upgrade to 2.0.3 if that would help at all.