Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7513811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:18:03+00:00 2026-05-30T00:18:03+00:00

I am trying to use external font in PDF document. I have no problem

  • 0

I am trying to use external font in PDF document. I have no problem with using it in iReport after installing it via Settings -> Fonts -> Install new font.

The problem that when I export the new font as extension and adding that jar to java project’s classpath – the PDF couldn’t be generated and fails with

JRFontNotFoundException: Font 'Arial Custom' is not available to the JVM exception

What I am doing wrong?
Thank you

UPD#1:

jasperreports_extensions.properties

net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.ireportfamily1329192368547=fonts/fontsfamily1329192368547.xml

fontsfamily1329192368547.xml

<?xml version="1.0" encoding="UTF-8"?>
<fontFamilies>

   <fontFamily name="Arial Custom">
       <normal><![CDATA[fonts/arial.ttf]]></normal>
       <bold><![CDATA[fonts/arialbd.ttf]]></bold>
       <italic><![CDATA[fonts/ariali.ttf]]></italic>
       <boldItalic><![CDATA[fonts/arialbi.ttf]]></boldItalic>
       <pdfEncoding><![CDATA[Identity-H]]></pdfEncoding>
       <pdfEmbedded><![CDATA[true]]></pdfEmbedded>
       <locales>
               <locale><![CDATA[en_US]]></locale>
       </locales>
   </fontFamily>    

</fontFamilies>

fonts directory includes all ttf files. I just added that jar to classpath.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:18:04+00:00Added an answer on May 30, 2026 at 12:18 am

    Here is my working sample.

    The font definition file (I dig it from the font’s jar file):

    <?xml version="1.0" encoding="UTF-8"?>
    <fontFamilies>
       <fontFamily name="Arial">
           <normal><![CDATA[fonts/arial.ttf]]></normal>
           <bold><![CDATA[fonts/arialbd.ttf]]></bold>
           <italic><![CDATA[fonts/ariali.ttf]]></italic>
           <boldItalic><![CDATA[fonts/arialbi.ttf]]></boldItalic>
           <pdfEncoding><![CDATA[Identity-H]]></pdfEncoding>
           <pdfEmbedded><![CDATA[false]]></pdfEmbedded>
       </fontFamily>
    </fontFamilies>
    

    The jar file is in the application’s classpath.

    And here is my java code:

    String defaultPDFFont = "Arial";
    
    JRProperties.setProperty("net.sf.jasperreports.awt.ignore.missing.font", "true");
    JRProperties.setProperty("net.sf.jasperreports.default.font.name", defaultPDFFont);
    
    JasperReport jasperReport = JasperCompileManager.compileReport(reportSource);
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params);
    
    JasperExportManager.exportReportToPdfFile(jasperPrint, outputFileName);
    

    I set the net.sf.jasperreports.awt.ignore.missing.font property to prevent the error you have (JRFontNotFoundException: Font 'Arial Custom' is not available to the JVM exception) in case the font is missing. And I set the net.sf.jasperreports.default.font.name property for determine the font that will be used in the resulting pdf file.

    You can read info about this properties: net.sf.jasperreports.awt.ignore.missing.font and net.sf.jasperreports.default.font.name.

    The resulting pdf file is using this font (Arial in this sample).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use jqModal to open some external links via AJAX using
I'm trying to use an external library (wingraph) in a simple program. I have
I have two questions: I am trying to embed fonts via this page in
I'm trying to use external api and display its results (after json parsing) on
I have an external datasource that implements IHierarchicalEnumerable. I'm trying to use that datasource
I am trying to use PEAR Mail to send using an external smtp server.
I am trying to use some external Framework in my iPhone app. I did
I am trying to learn how to use Cascadding Style Sheets. I have a
I'm trying to use create external controls for Fancybox, or somehow manipulate the controls
Trying to use parameter from external query in subquery FROM clause. tbl1: | id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.