Pentaho don't Generete PDF in UTF-8 encoding

2019-09-16 16:22发布

问题:

I have a problem related with PDF exportation in Pentaho BI plattform. I'm not able to produce a correct PDF file encoded in UTF-8 and which contains Spanish characters. That procedure neither works properly in local Report Designer nor in BI server. Special characters like 'ñ' or 'ç' are skipped in the PDF file. Generation in other formats works just fine (HTML, Excel, etc.).

I've been struggling with that issue for few days being unable to find any solution and would be grateful for any clue.

Thanks in advance

P.S. Report Designer and BI platform version 6.1.0.1

回答1:

Seems like a font issue. Your font needs to know how to work with unicode and it needs to specify how to "draw" the characters you want.

Office programs (at least MS office) by default automatically select font, which can render any character (if font substitution is enabled), however PDF readers don't do it: they always use the exact font you've specified.

When selecting appropriate font, you have to pay attention to supported Unicode characters and to the font's license: some fonts don't allow embedding and Pentaho embeds font's subset, which was used, into generated PDF files if encoding is UTF-8 or Identity-H.

To install fonts for linux server you need to copy font files either to your java/lib/fonts/ folder or to /usr/share/fonts/, grant read rights to the server's user and restart the server application.