JasperReports output format PDF issue

Hi Marc,

thanks. The Fonts are installed on the client-server. Both Arial and SansSerif are there. Im gonna check if the tomcat user can access them. But that shouldnt be a problem. Its the normal admin user.

What do you mean by “export the font jar files so jasperreports are using them” exactly?
Do you mean the .jar export from JasperStudio like discussed in this thread? If yes, in what folder do i place them in our tomcat-server\webapps\SOLUTION.… ?
For example: i tried to put the JasperStudio exported Arial.jar into our developer (application_server\plugins) folder. So that when we export the war, i can just export the Arial.jar within it. Didnt work :D
I also tried to place the Arial.jar into the reports folder where our reports are located on the client-server. Didnt work aswell.
I also tried to place it into tomcat\webapps\SOLUTION\META-INF\ (or WEB-INF).
I just cant find the right place to put it.

For the export: i guess i wrote it incorectly. I export the jasperplugin.jar with the war. It works fine, the reports are getting executed on the client-server.

What i meant is that, in older versions, where we shipped the servoy application server folder. There was a application_server\plugins\jasperreport folder. For smart-client solutions.
Now with TI and tomcat, when the .war gets unpacked by tomcat there is no \plugins\ folder. Only if we check the “enable Smart-client | RMI” option in the war-exporter. But we dont need that for TI, because no smart-client is used, only NG-Desktop Clients.

Tomorow i´m gonna check if the tomcat user has access rights to the installed fonts on the server.

I bet its something rly simple, that i just dont see!

Greetings
-Vik

Hi Vic,

in NG or Ti you should include the fonts on the tomcat application server, the so the pdf-files that are created on the server include the correct fonts. It’s not always enough to have the font installed on windows.

We had problems if the font is missing on the server in the server, even on systems including the fonts locally.

To install the font simply create the font-extension as discussed in this thread (described here https://community.jaspersoft.com/wiki/custom-font-font-extension)

To make the fonts accessible to the jasper-plugin copy the file in the plugin/servoy_jasperreports-folder in your developer, and modify the servoy_jasperreports.jar.jnlp to include the font_extension.jar.

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="%%serverURL%%" href="/servoy-client/plugins/servoy_jasperreports.jar.jnlp">
        <information>
                <title>Servoy Client Plugins</title>
                <vendor>Servoy and Others</vendor>
        </information>
        <resources>
                <j2se version="1.6+"/>
                <jar href="/plugins/servoy_jasperreports.jar" download="eager" version="%%version%%"/>
                <extension href="/plugins/servoy_jasperreports_commons.jar.jnlp" name="servoy_jasperreports_commons.jar" version="%%version%%"/>

                <extension name="svy_utils_excel.jar" href="/plugins/poi/svy_utils_excel.jar.jnlp" version="%%version%%"/>

                <jar href="/plugins/servoy_jasperreports/font_extension.jar" download="eager" version="%%version%%"/>
                <jar href="/plugins/servoy_jasperreports/jasperreports-6.19.1.jar" download="eager"/>
                <jar href="/plugins/servoy_jasperreports/commons-beanutils-1.9.4.jar" download="lazy" part="commons-beanutils" version="1.9.4"/>
                        <package name="org.apache.commons.beanutils.*" part="commons-beanutils" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/commons-collections-3.2.2.jar" download="lazy" part="commons-collections3" version="3.2.2"/>
                        <package name="org.apache.commons.collections.*" part="commons-collections3" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/commons-digester-2.1.jar" download="lazy" part="commons-digester" version="2.1"/>
                        <package name="org.apache.commons.digester.*" part="commons-digester" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/commons-logging-1.1.1.jar" download="lazy" part="commons-logging" version="1.1.1"/>
                        <package name="org.apache.commons.logging.*" part="commons-logging" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/groovy-3.0.7.jar" download="lazy" part="groovy" version="3.0.7"/>
                        <package name="org.codehaus.groovy.*" part="groovy" recursive="true"/>
                        <package name="groovy.*" part="groovy" recursive="true"/>
                        <package name="groovyjarjarantlr.*" part="groovy" recursive="true"/>
                        <package name="groovyjarjarasm.asm.*" part="groovy" recursive="true"/>
                        <package name="groovyjarjarcommonscli.*" part="groovy" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/ecj-3.21.0.jar" download="lazy" part="jdt-compiler" version="3.21.0"/>
                        <package name="org.eclipse.jdt.*" part="jdt-compiler" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/serializer-2.7.2.jar" download="lazy" part="serializer" version="2.7.2"/>
                        <package name="org.apache.xml.serializer.*" part="serializer" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/xalan-2.7.2.jar" download="lazy" part="xalan" version="2.7.2"/>
                        <package name="org.apache.*" part="xalan" recursive="true"/>
                        <package name="java_cup.runtime.*" part="xalan" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/xml-apis-1.4.01.jar" download="lazy" part="xml-apis" version="1.4.01"/>
                        <package name="javax.xml.*" part="xml-apis" recursive="true"/>
                        <package name="org.w3c.dom.*" part="xml-apis" recursive="true"/>
                        <package name="org.xml.sax.*" part="xml-apis" recursive="true"/>
                        <package name="org.apache.xmlcommons.Version" part="xml-apis" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/xml-apis-ext-1.3.04.jar" download="lazy" part="xml-apis-ext" version="1.3.04"/>
                        <package name="org.w3c.css.sac.*" part="xml-apis-ext" recursive="true"/>
                        <package name="org.w3c.dom.smil.*" part="xml-apis-ext" recursive="true"/>
                        <package name="org.w3c.dom.svg.*" part="xml-apis-ext" recursive="true"/>
        </resources>
        <component-desc></component-desc>
        <security>
                <all-permissions/>
        </security>
</jnlp>

Then build your WAR-File, and the fonts will be included, since the servoy_jasperreports.jar.jnlp gets parsed.

Can you check if after building the file is included? It should be under /WEB-INF/lib/font_extension.jar

Hi Vik,

vik.lamp.vl:
What do you mean by “export the font jar files so jasperreports are using them” exactly?

Export the font from Jasper Studio as jar file.(font-extension)
I always put the files in the plugins/servoy_jasperreports folder

Once exported as war, you should see the file in [ROOT]/plugins/servoy_jasperreports folder as well

As far as I know (and experience) you don’t have to change the jnlp file as described by Robert.
jnlp files are used by Java client (like smart client), but on the server the jar files will just be loaded.

Hope this helps

Hi Robert,

thanks! Followed your advice and it worked!

So the .JNLP edit is necessary even for NG/TI Solutions, so that the font_extension.jar gets build/exported with the .war builder.
Good to know :)