I'm using iText to create a PDF with Chinese characters. The Font I specified is MS Mincho which I had loaded using the code,
FontFactory.registerDirectory("c:/windows/Fonts/");
new Phrase("Asian 汉字/漢字 characters", FontFactory.getFont("MS Mincho", 16, Font.NORMAL));
The code below retrieves appropriately the MS Mincho font (i.e. not null),
FontFactory.getFont("MS Mincho", 16, Font.NORMAL)
However, the generated PDF only displays the ASCII text "Asian characters", i.e. the chinese characters are not displayed on the PDF.
Any idea as to why the chinese characters are missing on the generated PDF?
BaseFont.IDENTITY_H
) and b) embed it (BaseFont.EMBEDDED
). Be inspired by the samples from chaptrer 11 of iText in Action — 2nd Edition. – mklFontFactory
can likewise be used to create appropriately parameterized font objects. But true, you don't need it. – mkl