3

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 handling diffrent encodings.

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

Community
  • 1
  • 1
Oglop
  • 260
  • 1
  • 3
  • 11

0 Answers0