Jump to content
Changes to the Jaspersoft community edition download ×
  • What happens if you reference a Font in a pdf but choose not to embed it?


    ghudson_1
    • Product: JasperReports® Server

    Issue Description

    Typically customers desire to embed their font within their PDF so ensure the look & feel of their PDF matches their desired font in all viewing circumstances, even when end-users don't have that font installed on their client-OS.  For management of Fonts with respective to PDF you should use the font-extension feature:

    http://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v630/fonts

    But occasionally customer need to embed the font for size-reasons, or they accidentally choose to not embed the font.


    Resolution

    When defining your font extension to help define the fonts for your JRXML, you can make a few PDF-specific settings.  

    a) You can set "PDF Font Name" to provide an alternative font are used in PDF files nstead of the font you are defining for the rest of your reports.  The options are one of the PRF Standard 'core' fonts.  The PDF Standard contains a few 'core' fonts, these are the families of Helvetica, Courier, Symbol, Times Roman, ZapfDingbats, etc.   Thes core fonts don't need to be embedded, they are always inherent to PDF files.   This is useful if someone wants their .docx and .html exports to use a specific font like Calibri but are okay with PDF using one of the 'core' fonts instead.

    b) You can choose whether to embed the font or not.  As described elsewhere if you reference a font within a PDF but do not embed it, then you are relying on the client-OS to provide the font data (the .ttf files for example).  If they are not present, the font will be unreadable.  

    In the below example we're okay with Helvetica being used instead of Arial so we don't need to embed.

    font-extension_sm.jpg.21c4d62636573018e02564ee8a837260.jpg

    You can tell whether or not your PDF has font embedded or not by opening the file in Adobe Acrobat, going into File -> Properties (or Control D) and looking for the word "embedded":

    controlDwith(1).JPG.c7231b2755ff56ca46c7f33b3ff5995b.JPG

    controlDnoembed.JPG.9f808b0468f9c6118d6f93d9cc418afc.JPG

    The above two were created using a blank or empty "PDF Font Name" , so Arial is the referenced font, but obviously the lower image shows no embedding.  If you viewed this PDF on a machine which did not have Arial font installed at the OS level if would be unreadable, like:

    withoutCapture.JPG.756fd912b222cbb85067ab3caada6b0a.JPG


    References:

    http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.xls.workbook.template


    Ref. Case 01468397

    withoutCapture.JPG.759fc0c7eff1e1adf94f65d995bdcfd6.JPG


    User Feedback

    Recommended Comments

    Hi,
    I'm having some toruble with the non emedded font that I do not want to be incorporated in the report. When I generate the pdf and go to the Properties > Fonts I see my 3 desired embedded fonts and a fourth not embedded font that is Helvetica. I tried to eliminate it and searched how to do it but no solution. Could you please give me a hand?

    Thank you,
    Anita

    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...