Custom font with PDF export

0

Hello.

When I created the report, I encountered the following problem. I loaded a сгыещь font and use it to display the text field. When it overflows on the current page, this field is moved to the next page.
When looking at the result in Jaspersoft Studio, the result is correct, but when export to PDF, some of the text disappears after transferring to the next page.

How to be in this case?

antosha.akinshin's picture
Joined: Apr 14 2017 - 2:11am
Last seen: 2 years 2 months ago

5 Answers:

0

HTML export relies on the client-Browser (chrome, firefox, etc) to fetch the true font from the OS. 

PDF doesn't have this ability, so if you aren't referencing one of the handful of 'CORE' fonts which are part of the PDF Spec/Standard, then you actually embed the ttf in the PDF.   Easiest way to do this is via Font extensions, see the font extensions chapter in the Studio User Guide.

ghudson_1's picture
24725
Joined: Oct 30 2012 - 12:51pm
Last seen: 4 days 9 hours ago
0

Jaspersoft Studio by default display a report using Java GUI which uses fonts available to Jaspersoft Studio. In the case of PDF, pdf viewer needs acces to the fonts. This can be done by including fonts in to the pdf using font extentions in JasperReports.

https://community.jaspersoft.com/wiki/custom-font-font-extension

hozawa's picture
52632
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 1 week ago
0

 

We loaded the fonts according to the instructions, but nothing has changed. Now when viewing the report in JasperSoft Studio you can see:

Page 1:

 

Page 2:

 

 

The first page ends with line 52, on the second page begins 53.

If export to PDF, then

Page 1:

 

Page 2:

 

The first page ended 49, the second began 53. The lines 50, 51,52 disappeared. If export to RTF, you can see why the missing lines do not fit on the first page, and remain on the first page, not moving to the second page:

 

 

 

I can not understand, why this happens?

antosha.akinshin's picture
Joined: Apr 14 2017 - 2:11am
Last seen: 2 years 2 months ago
0

Are you using the latest version? Some earlier versions had a bug with font extension.

BTW, your images aren't being displayed.

hozawa's picture
52632
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 1 week ago
-1

I think you need to add font explicitly, here is setp by step guide to add custom font in jasper reports.

sehrishnaz47's picture
Joined: May 16 2018 - 4:08am
Last seen: 1 week 6 days ago
Feedback
randomness