开发者

Internationalization with PDFBox

开发者 https://www.devze.com 2023-04-08 16:04 出处:网络
I have been using PDFBox in my project to create pdf files containing som data from my program. It has been working great up till now as starting to add new languages starting with japanese.

I have been using PDFBox in my project to create pdf files containing som data from my program. It has been working great up till now as starting to add new languages starting with japanese.

I have tried this:

font = PDTrueTypeFont.loadTTF( doc, new File( "fontFile.ttf" ) );

It seems to be an encoding problem in pdfbox.

font.setFontEncoding(new PdfDocEncoding());

I have tried diffrent fonts like Unicode font from my computer and MPlus but not realy getting anywhere. Looking around the internet it seems pdfbox has truoble handling characters in diffrent languages.

My question is, should I continue this? next comes russian, persian, thai, languages like that. I fear i will get stuck with each new language even if I get japanese to work.

My options as I see them is to try a diffrent library, flying-saucer, beeing the hot candidate. The other option would be to write a .doc file with open office UNO, as discussed here, and hopefully get around the whole headache of handli开发者_如何学编程ng diffrent encodings.

Soo.. have anyone been working with pdfbox and gotten internationalization to work or should i try a diffrent strategy?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号