JasperReports output format PDF issue

Questions and answers on developing, deploying and using plugins and JavaBeans

JasperReports output format PDF issue

Postby tgs » Tue Nov 05, 2019 12:42 pm

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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby mboegem » Tue Nov 05, 2019 3:23 pm

Look like as if the PDF doesn't use the correct font.

Please have a look here:
viewtopic.php?f=15&t=14008
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1573
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: JasperReports output format PDF issue

Postby alk » Tue Nov 05, 2019 4:12 pm

Hallo Thomas,

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

Best
Ralf
alk
 
Posts: 43
Joined: Wed May 21, 2014 8:34 pm
Location: Berlin

Re: JasperReports output format PDF issue

Postby tgs » Tue Nov 05, 2019 8:17 pm

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 5105 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.
Last edited by tgs on Tue Nov 05, 2019 9:26 pm, edited 1 time in total.
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby tgs » Tue Nov 05, 2019 8:23 pm

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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby alk » Wed Nov 06, 2019 5:54 pm

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
alk
 
Posts: 43
Joined: Wed May 21, 2014 8:34 pm
Location: Berlin

Re: JasperReports output format PDF issue

Postby tgs » Wed Nov 06, 2019 6:23 pm

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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby murmi » Mon Nov 11, 2019 11:25 am

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
Fritz Maurhofer
Maurhofer Informatik AG
CH-8340 Hinwil
murmi
 
Posts: 32
Joined: Thu Jul 22, 2010 5:10 pm

Re: JasperReports output format PDF issue

Postby mnaeimi » Mon Nov 11, 2019 12:26 pm

Font_extension.jar needs to be copied in <servoy_install_path>/application_server/plugins/servoy_jasperreports folder.
Mina @ Servoy
mnaeimi
 
Posts: 26
Joined: Fri Jun 08, 2012 2:48 pm

Re: JasperReports output format PDF issue

Postby tgs » Mon Nov 11, 2019 2:32 pm

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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby tgs » Wed Nov 13, 2019 8:05 pm

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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby mnaeimi » Thu Nov 14, 2019 11:53 am

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" />
Mina @ Servoy
mnaeimi
 
Posts: 26
Joined: Fri Jun 08, 2012 2:48 pm

Re: JasperReports output format PDF issue

Postby tgs » Thu Nov 14, 2019 7:37 pm

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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby lwjwillemsen » Thu Nov 14, 2019 8:11 pm

I wish there was some "good" documentation available on this topic on ServoyForge...
Maybe Santa will bring it along (or maybe Sinterklaas) :wink:
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 673
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: JasperReports output format PDF issue

Postby mnaeimi » Mon Nov 18, 2019 4:17 pm

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.
Mina @ Servoy
mnaeimi
 
Posts: 26
Joined: Fri Jun 08, 2012 2:48 pm

Next

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 2 guests

cron