4

I have created a report using Pentaho Report Designer 3.9.1 and it contains Japanese characters. When I try to export the report into PDF, I am not getting the Japanese characters in PDF. Instead of Japanese characters it's showing as empty in PDF.

When I try to export into Excel, Japanese characters are displaying.

halfer
  • 19,824
  • 17
  • 99
  • 186
Rajasekaran M
  • 163
  • 2
  • 16

2 Answers2

3

It is known that built-in fonts of the JDK are mapped to built-in fonts ( SANS-SERIF, SERIF OR ANY OTHER BUILT-IN FONT) of the PDF standard and that these fonts do not support anything other than western-european languages.

These fonts are not defined to include any Japanese characters as Japanese is not a western european language. If you use a font that does not include Japanese characters, you cannot expect it to display these characters.

Configuration that is needed is in PRD.

  • Click on File | Configuration
  • Click on 'output-pageable-pdf'
  • Set '~.EmbededFonts' to True
  • Set '~.Encoding' to UTF-8

The reason behing the japanese font working with PDF because, if you are using a metadata as the datasource, the metadata fonts for that field will be having a default font set one say example "Arial-10". You will have to edit the font there or you will have to manually override it in the report designer by setting the "data-format and the style-format" to false.

To get the result in BAServer:

  • Stop BA Server.
  • Browse to this file:

\biserver-ee\tomcat\webapps\pentaho\WEB-INF\classes\classic-engine.properties

  • Change the following properties.

org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Encoding=UTF-8 org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.EmbedFont‌​s=true

  • Start the server.

Update : As per Rajasekaran M, he had to use the font SimHei in PRD and add simhei.ttf to fonts, inorder to work it in both PRD and BIServer.

Marlon Abeykoon
  • 11,927
  • 4
  • 54
  • 75
  • Thanks Marlon.. It works for me when i try to export PDF using Pentaho Report designer.. However when i try to export the report as PDF using Pentaho BI Server, i am getting the same empty values instead of Japanese characters in my PDF. Please help me what changes i need to do in Pentaho BI server level to get the Japanese characters in PDF export. – Rajasekaran M Sep 16 '15 at 07:28
  • I have checked the above directory and the file, We already have UTF-8 for the PDF. Please give me any other workaround. – Rajasekaran M Sep 16 '15 at 09:34
  • FYI: I am giving "Yu Gothic" As font family in my Pentaho Report designer. Is this cause any problem in BI server for displaying Japanese characters in PDF Export? – Rajasekaran M Sep 16 '15 at 09:54
  • Can you google some other Japanese character set and put there and try again. I have no idea about that Yu Gothic. You may post it as another Question. If I find any I'l let you know. – Marlon Abeykoon Sep 16 '15 at 09:57
  • Use fonts like "Arial Unicode MS" Its said like that in http://forums.pentaho.com/showthread.php?153119-UTF-8-not-working-in-PDF-version – Marlon Abeykoon Sep 16 '15 at 10:10
  • Thanks Marlon.. Do you have any idea of what font we need to give in Pentaho Report designer to export Japanese characters. Since if i give default font in PRD, I am unable to export Japanese characters in PDF. But i give Yu Gothic font, then i can.. Please suggest me any other font family for Japanese character export if you know..Thanks again for your reply. – Rajasekaran M Sep 16 '15 at 10:12
  • Try this setting as well in the .property file I mentioned. `org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.EmbedFonts=true` to fix that in BAServer export. I'l search more. – Marlon Abeykoon Sep 16 '15 at 10:14
  • I have tried using "Arial Unicode MS".. But still facing the same issue in export – Rajasekaran M Sep 16 '15 at 10:17
  • Yes Marlon, I have also added the above line in .properties file and restarted the BI server. But facing the same issue which Japanese characters are showing empty in PDF export. – Rajasekaran M Sep 16 '15 at 10:40
  • Hi Marlon, I have changed the Report font into "SimHei" in Report designer and deployed into BI server. Then added the simhei.ttf in fonts. It worked for me in BI server too.. Thank you very much for your Overall Helps. You saved me lots – Rajasekaran M Sep 16 '15 at 11:03
  • @RajasekaranM Nice to hear it worked. Then It was a problem with fonts. – Marlon Abeykoon Sep 16 '15 at 11:08
0

For who have the utf-8 issue with BI server on Linux, you may need to add font for machine. Below is what I done to resolve:

  • copy fonts to usr/share/font/your-fonts (not work if copy to /home/your-user/.fonts)
  • add font command: $ fc-cache -fv
  • To list all font: $ fc-list
Kien Ngo
  • 41
  • 3