PDF encoding - Not printing characters on export

Hello,

I'm having some issues when exporting a report to pdf with Romanian words.

As you can above, when it is on the Jasper Studio preview mode, the characters appear correctly:

However, when exporting to PDF, the characters are not printed at all:

I've searched many other questions and none of the answers solved my problem. Here's what I've tried so far:

  • Change report property: net.sf.jasperreports.export.character.encoding=ISO-8859-1
  • Change pdfEncoding on text field to "Cp1252"
  • Change pdf font name
  • Set pdfEmbeded to true

Can somebody help me on this, please? This is somehow urgent.

Thank you in advance.

Br,
Marques

mmarques6's picture
140
Joined: Feb 19 2014 - 9:10am
Last seen: 4 years 4 months ago

4 Answers:

You need to use a font that includes glyphs for Romanian characters.  The one used in the article example doesn't.

If you don't have a specific font that you want to use, you can use DejaVu Sans which is bundled in jasperreports-fonts.jar (you can get it from https://sourceforge.net/projects/jasperreports/files/jasperreports/Jaspe...).

Regards,

Lucian

lucianc's picture
72254
Joined: Jul 17 2006 - 1:10am
Last seen: 38 min 59 sec ago
hozawa's picture
169763
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 9 months ago

Thank you for the suggestion hozawa.

I tried setting up font extension (based on that example) and it didn't work:

Do you/somebody have any other suggestion?

Thanks!

 

mmarques6's picture
140
Joined: Feb 19 2014 - 9:10am
Last seen: 4 years 4 months ago

Thank you so much lucianc!

Changing the font to DejaVu Sans worked!

Br,

Marques

mmarques6's picture
140
Joined: Feb 19 2014 - 9:10am
Last seen: 4 years 4 months ago
Feedback
randomness