Jump to content
We've recently updated our Privacy Statement, available here ×

Can not show Japanese characters in a pdf using jasper reports


manolov.petar

Recommended Posts

Using jasper reports version 1.3 to make pdf reports. Struggle producing a report in japanese. The font used is Code2000.ttf
The font is defined as follows in .jrxml file:

<reportFont name="font-normal" isDefault="true" fontName="Code2000" size="9" isBold="false" isItalic="false"            isUnderline="false" isStrikeThrough="false" pdfFontName="CODE2000.TTF" pdfEncoding="UTF-8"            isPdfEmbedded="true"/><reportFont name="font-bold" isDefault="false" fontName="Code2000" size="9" isBold="true"  isItalic="false"            isUnderline="false" isStrikeThrough="false" pdfFontName="CODE2000.TTF" pdfEncoding="UTF-8"            isPdfEmbedded="true"/>[/code]

Part of the report below:
index(42).png.8dc3a2e338b5614b026f82370406fef1.png

Using UTF-8, the font is shown as embedded in the pdf file, however the encoding is shown as custom. We also tried using Identity-H encoding for this font, but got java.io.UnsupportedEncodingException: Identity-H. We tried with HeiseiKakuGo-W5 font with UTF-8 encoding with the same result.

We would appreciate any help resolving this.

index(42).png.d68de5e413c804362244cce920832f48.png

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Hello,

newer JasperReports are using font extensions to correctly embed the fonts inside the PDF. However, since you use Jasper 1.3, you'll need to make sure that the pdfFontName and pdfEncoding are correct. In your case it looks like pdfFontName but for PDF encoding you may want to try Identity-H instead of UTF-8.

If that doesn't still work, right click anywhere in generated PDF, go to Document Properties -> Fonts. Do you see your font embedded there? If not, there may be also an issue with font not available to JasperReports during the report compilation.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...