This article explains how to use TTF fonts in your PDF files. TTF fonts allow you to use national character set, like greek or arabic characters, or just if you want to use fonts other than the default PDF ones.

Step 1

Create the font metric files and the FOP configuration file as explained in our Guide, look for the section "How to add new fonts".

Step 2.

Configure the Print Server to use the created files

If you use: J4L FOP Server

Copy the foUserConfig.xml file to the working directory of the server. This is commuonly "c:\program files\J4LFOPServer".

If you have deployed our print server (J4LFOPServer.war file) inside your web server you can find the working directory by setting the print server in debug mode and looking for the "dummy.txt" entry

Here you find a sample configuration file for our server.

If you use: External print server

If you use the fop.war file delivered with APEX you will need  to do some changes in the JPS file.

  1. rename fop.war to

  2. extract the file apex_fop.jsp

  3. before the "new Driver()" line, add

    Options options = new Options(new File("c:\\mydirectory\\config.xml"));

    here you find a sample configuration file for FOP 0.25

  4. before the ";" line add

     out = pageContext.pushBody();

  5. update now the jsp in the file

  6. rename the zip file to war file and deploy in to your server (for example glassfish)

  7. if you get an error relating missing oracle.xml.parser.v2 packe you will need to inlcude also the file xmlparserv2.jar in  the fop.war file (WEB-INF\lib subdirectory). This can be found in the Oracle XML Developer Kit (XDK).