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.
3 Answers:
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.
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.
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.
Thank you. You saved my day!