Jump to content
Changes to the Jaspersoft community edition download ×

Non-embedded Helvetica font appearing in PDF


aklingel

Recommended Posts

 I am trying to ensure that the fonts we use in JasperReports are always embedded so that our customers can send the files to a print company.

We have purchased a couple of fonts for this purpose: HelveticaLTCom-Roman and HelveticLTCom-Bold. They are TTF files, and have been added to iReport and also in a jar file with a fonts.xml file.

However, when we generate a PDF using either iReport or running a java command, there is ALWAYS an additional font called "Helvetica" in the PDF file.

To see if it was my problem, I created a simple report with only one static text field in the file, and ran it.  The static text field has HelveticaLTCom-Roman assigned to it.

Sure enough, both fonts appear in the PDF file in Acrobat when I do File --> Properties.

There are NO undefined fonts in the file.  Why is JasperReports doing this? It's maddening!

I'm certain there is something I am missing. The Linux server on which this is running has no regular Helvetica font, so I couldn't embed it even if I wanted to. I must get rid of it.

I also saved PDF output as a .ps file so that I could read it and sure enough, you can see findfont Helvetica in there.

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

JR creates a PDF anchor to an empty text at the beginning of each exported page.  The text uses the default style defined in the report, or default PDF font attributes if there's no default style.

Hence adding to the report a default style that uses one of your fonts should fix this.  However, there's currently a bug that prevents that from working when font extensions are used.  Log a bug for that to get it fixed.

So at the moment you can only achieve what you want by using e default style that specifies its own pdfFontName, pdfEncoding and isPdfEmbedded attributes.

Regards,

Lucian

Link to comment
Share on other sites

  • 1 year later...

My apologies for necroposting, please let me know if I need to create a new thread for this.

Has this bug been corrected? I am encountering the same issue and under UNIX or printer is rejecting the PDFs containing my Ireports. I have replaced the default font with Times New Roman, exported to a jar and replaced the default Helvetica by creating a default style using Times New Roman.

Helvetica is still appearing in the PDF somehow and as a result I'm left unable to print any generated reports.

Details of my Ireports install:

Product Version: Jaspersoft iReport Designer 4.0.1

Java: 1.6.0_17; Java HotSpot Client VM 14.3-b01

System: Windows 7 version 6.1 running on x86; Cp1252; en_US (ireport)

Userdir: C:Usersmwatkins.ireport4.0.1

 



Post Edited by mwatkinson at 07/15/2011 19:10
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
  • 3 weeks later...
  • 2 years later...

This bug (unwanted Helvetica in PDF) occurs when my default style has conditional font selection. Here is a sample:

<style name="def" isPdfEmbedded="true" pdfEncoding="utf-8" isDefault="true">

<conditionalStyle>

<conditionExpression><![CDATA[boolean.TRUE]]></conditionExpression>
<style fontName="Arial" pdfFontName="Courier" />
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[boolean.FALSE]]></conditionExpression>
<style fontName="Times" pdfFontName="Times" />
</conditionalStyle>
</style>
 
After PDF report is built I notice "Helvetca" in the font list.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...