XSL-FO Designer for Apache FOP

Installing TTF fonts

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 commonly "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: Oracle APEX ORDS 5.*

Edit the ORDS configuration file default.xml , add the following line:

<entry key="fop.configfile">C:\ords\ords\fopUserConfig.xml</entry>

Replace the bold text with your own directory (place the fopUserConfig.xml where you like)

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

  1. rename fop.war to fop.zip

  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 "driver.run();" line add

     out.clear();
     out = pageContext.pushBody();

  5. update now the jsp in the fop.zip 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).