views:

372

answers:

1

When I create a PDF from a Jasper Report, the resulting PDF declare to use "Helvetica" font, even if it doesn't contain text. Unfortunately I cannot embed "Helvetica" font, because it is not among the Windows fonts. Based on the PDF/A rules, I need to embed all the fonts in the PDF file.

How can I create from Jasper a PDF that doesn't declare to use Helvetica?

Thank you in advance.

Fabio

A: 

Hi,

You could try out a few things, have you look into the reportFont element?

<!ELEMENT reportFont EMPTY> 
<!ATTLIST reportFont
     name CDATA #REQUIRED 
     isDefault (true | false) "false" 
     fontName CDATA #IMPLIED 
     size NMTOKEN #IMPLIED 
     isBold (true | false) #IMPLIED 
     isItalic (true | false) #IMPLIED 
     isUnderline (true | false) #IMPLIED 
     isStrikeThrough (true | false) #IMPLIED 
     pdfFontName CDATA #IMPLIED 
     pdfEncoding CDATA #IMPLIED 
     isPdfEmbedded (true | false) #IMPLIED
> 

However, note that report fonts are now deprecated, so you might wanna check out the style element:

<!ELEMENT style (conditionalStyle*)> 
<!ATTLIST style
     name CDATA #IMPLIED 
     isDefault (true | false) "false" 
     ...
     forecolor CDATA #IMPLIED 
     isStyledText (true | false) #IMPLIED 
     fontName CDATA #IMPLIED 
     fontSize NMTOKEN #IMPLIED 
     isBold (true | false) #IMPLIED 
     isItalic (true | false) #IMPLIED 
     isUnderline (true | false) #IMPLIED 
     isStrikeThrough (true | false) #IMPLIED 
     pdfFontName CDATA #IMPLIED 
     pdfEncoding CDATA #IMPLIED 
     isPdfEmbedded (true | false) #IMPLIED
     pattern CDATA #IMPLIED 
     isBlankWhenNull (true | false) #IMPLIED
>

pdfFontName should be the name of the font you are planning to use. This could either be a predefined PDF font or the name of a TTF file present in the classpath. In case you are using a TTF then note that isPdfEmbedded specifies whether an external TrueType font (TTF) file should be included in the PDF file or not

Regards!

spderosso