Page 1 of 2

JasperReports output format PDF issue

PostPosted: Tue Nov 05, 2019 12:42 pm
by tgs
When I make plugins.jasperPluginRMI.runReport() with OUTPUT_FORMAT.PDF the text formatted as "bold" is displayed as normal/standard.
The reports are correct on output format PRINT and/or HTML.
I have tried the JasperReports Basic Plugin version 6.0.0 up to 6.4.1, but always the same.

I need a correct output of the reports as PDF. Any suggestions what I can do?


Servoy 7.4.11
Java 1.8.0_231
macOS Mojave
Jaspersoft Studio 6.4.0

Re: JasperReports output format PDF issue

PostPosted: Tue Nov 05, 2019 3:23 pm
by mboegem
Look like as if the PDF doesn't use the correct font.

Please have a look here:
viewtopic.php?f=15&t=14008

Re: JasperReports output format PDF issue

PostPosted: Tue Nov 05, 2019 4:12 pm
by alk
Hallo Thomas,

same experience.
You have to import fonts-files as jar to use them,
for example
Arial.jar

Best
Ralf

Re: JasperReports output format PDF issue

PostPosted: Tue Nov 05, 2019 8:17 pm
by tgs
mboegem wrote:Look like as if the PDF doesn't use the correct font.

Hi Marc,

I have read this topic before, but there are some differences like:
Reports are displayed correct in JasperViewer
iReport -> Jaspersoft Studio
jr_fonts.png
jr_fonts.png (117.56 KiB) Viewed 11287 times

I get only this fonts from the menu for PDF Font Name.

*Edit*
PDF Font Name menu is only for replacement the set font.

Re: JasperReports output format PDF issue

PostPosted: Tue Nov 05, 2019 8:23 pm
by tgs
alk wrote:You have to import fonts-files as jar to use them,
for example
Arial.jar

Hi Ralf,

thank you for the reply.

Where do I have to import the fonts-file?
*Edit*
On this wiki (https://community.jaspersoft.com/wiki/c ... -extension) is a how to, but I miss the "Java Build Path" menu entry for import.

How do I create i.e. an Arial.jar from the Arial.ttf font?
*Edit*
On the Properties Dialog in my previous post I can "Export" the font family as .jar.

Best regards

Re: JasperReports output format PDF issue

PostPosted: Wed Nov 06, 2019 5:54 pm
by alk
Hi Thomas
yes I think I just had to export them (Fritz Maurhofer:do you remember?)
I deployed them to user direktory
C:\Users\ralfa\JaspersoftWorkspace\MyReports

Best
Ralf

Re: JasperReports output format PDF issue

PostPosted: Wed Nov 06, 2019 6:23 pm
by tgs
Hi Ralf,

unfortunately I don't remember...

Putting the font.jar into the JasperoftWorkspace/Reports directory doesn't work.

If I have set the created (and exported as .jar) font family for pdf (i.e. Arial_pdf.jar) in Jaspersoft Studio to text fields on my report, but I always get this error:
<< java.lang.Exception: net.sf.jasperreports.engine.util.JRFontNotFoundException: Font "Arial_pdf" is not available to the JVM. See the Javadoc for more details. >>

I think the font.jar must be stored in Servoy server directory (or Tomcat for NGClient), but where? I don't remember and server > webapps > ROOT is also not working.

In the Jasperreports Wiki is only discribed the how to for the Jasper Server.
I was in hope to find anything on servoyforge, but the webserver is currently down...

Best regards

Re: JasperReports output format PDF issue

PostPosted: Mon Nov 11, 2019 11:25 am
by murmi
Hi Thomas

As far as I can see, I just put the respective fonts.jar in the Directory
application_server\plugins\servoy_jasperreports\

HTH
Fritz

Re: JasperReports output format PDF issue

PostPosted: Mon Nov 11, 2019 12:26 pm
by mnaeimi
Font_extension.jar needs to be copied in <servoy_install_path>/application_server/plugins/servoy_jasperreports folder.

Re: JasperReports output format PDF issue

PostPosted: Mon Nov 11, 2019 2:32 pm
by tgs
Hi Fritz @murmi,
hi Mina @mnaeimi,

thank you for reply! Now it works perfect.

*Edit*
Currently works only in Debug Client on Servoy Developer.
With Smart Client on production server I get an empty report with errors I have to investigate.

Best regards

Re: JasperReports output format PDF issue

PostPosted: Wed Nov 13, 2019 8:05 pm
by tgs
Ok, I have copied my Arial_pdf.jar extension font to <servoy_install_path>/application_server/plugins/servoy_jasperreports folder on the production server and signed it.
But I still get the error:
ERROR - JRViewerPanel - Page paint error.
net.sf.jasperreports.engine.util.JRFontNotFoundException: Font "Arial_pdf" is not available to the JVM. See the Javadoc for more details.

I got this error message also in the Debug Client of Servoy Developer, but as soon as I have copied the Arial_pdf.jar into the .../servoy_jasperreports direction, all is working as expected.

Of course, I have restarted the server before trying to create a report.

Any suggestions are appreciated.

Best regards

Re: JasperReports output format PDF issue

PostPosted: Thu Nov 14, 2019 11:53 am
by mnaeimi
OK, you are using smart client, then you need to edit servoy_jasperreports.jar.jnlp file and add Arial_pdf.jar to it.
Like following:
<jar href="/plugins/servoy_jasperreports/Arial_pdf.jar" download="lazy" />

Re: JasperReports output format PDF issue

PostPosted: Thu Nov 14, 2019 7:37 pm
by tgs
Great Mina! Thank you.

I have modified the .jar.jnlp now also on my customers application server.
Reports get created without errors and the PDF's are as expected.

Best

Re: JasperReports output format PDF issue

PostPosted: Thu Nov 14, 2019 8:11 pm
by lwjwillemsen
I wish there was some "good" documentation available on this topic on ServoyForge...
Maybe Santa will bring it along (or maybe Sinterklaas) :wink:

Re: JasperReports output format PDF issue

PostPosted: Mon Nov 18, 2019 4:17 pm
by mnaeimi
There is some documentation in servoy-forge website https://www.servoyforge.net/projects/se ... ease_notes
but I agree that it is not easily available. It should be added to servoy-jasperreports wiki page not in release note.