PDF does not highlight bold text

 

I'm having trouble exporting report to PDF using jasper. It simply does not highlight bold text. But when displaying the report on the screen the bold appears normally.

I, m using Arial font.

Does anyone have any idea how to resolve this issue?

I'm sorry for my bad english.

wendel086's picture
Joined: Jun 15 2020 - 5:54am
Last seen: 1 week 7 hours ago

The issue you are running into is that java doesn't recognize Arial without a little setup.  In the preferences goto Jaspersoft Studio|Fonts.  Create a new font family for Arial specifying the correct normal, bold, italic, and bold italic ttf font.

Style
Name

normal
c:\windows\fonts\arial.ttf

bold
c:\windows\fonts\arialbd.ttf

italic
c:\windows\fonts\ariali.ttf

bold italic
c:\windows\fonts\arialbi.ttf

Once you are done with that click the export button and create a library of the font.  I put mine in MyReports\Fonts folder.  Then studio on the project explorer navigate to the Arial.jar file you just created right-click and select Build Path|Add to Build Path.

This should result in exported PDF using Arial and not swapping the font for Helvetica which is the default sans-serif font for Java.

jgust - 2 years 5 months ago

I tried to do that, but I was unsuccessful. I am using jasperstarter on the Linux operating system.
 
Now, I get an error: "Arial font not found"
 
it's like I don't have the .jar file in my library folder, but it's there.

wendel086 - 2 years 4 months ago

Thank you. You saved my day!

wendel086 - 2 years 4 months ago

3 Answers:

problem solved!
 
just put the extension of the sources in the folder
 
vendor/geekcom/phpjasper/bin/jasperstarter/jdbc
wendel086's picture
Joined: Jun 15 2020 - 5:54am
Last seen: 1 week 7 hours ago

The issue you are running into is that java doesn't recognize Arial without a little setup.  In the preferences goto Jaspersoft Studio|Fonts.  Create a new font family for Arial specifying the correct normal, bold, italic, and bold italic ttf font.

Style
Name

normal
c:\windows\fonts\arial.ttf

bold
c:\windows\fonts\arialbd.ttf

italic
c:\windows\fonts\ariali.ttf

bold italic
c:\windows\fonts\arialbi.ttf

Once you are done with that click the export button and create a library of the font.  I put mine in MyReports\Fonts folder.  Then studio on the project explorer navigate to the Arial.jar file you just created right-click and select Build Path|Add to Build Path.

This should result in exported PDF using Arial and not swapping the font for Helvetica which is the default sans-serif font for Java.

jgust's picture
4345
Joined: Jun 10 2010 - 6:39am
Last seen: 8 hours 54 min ago
I tried to do that, but I was unsuccessful. I am using jasperstarter on the Linux operating system.
 
Now, I get an error: "Arial font not found"
 
it's like I don't have the .jar file in my library folder, but it's there.
wendel086's picture
Joined: Jun 15 2020 - 5:54am
Last seen: 1 week 7 hours ago
Feedback
randomness