jeudi 27 septembre 2018

How to display Chinese characters in java web applications?

I use Itext 5 to create pdf file. I refer to https://developers.itextpdf.com/examples/itext-action-second-edition/chapter-1 and get a pdf. When I open it, Chinese characters display normally.

But I develop web applications like https://developers.itextpdf.com/examples/itext-action-second-edition/chapter-9 described. Chinese characters is blank when pdf show in browser.

My font code is

String chFontPath = "c:\fonts\xxx.ttf"; BaseFont chBaseFont = BaseFont.CreateFont(chFontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED); Font font = new Font(chBaseFont, 12);

Does anybody know?




Aucun commentaire:

Enregistrer un commentaire