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.
Create the font metric files and the FOP configuration file as explained in our Guide, look for the section "How to add new fonts".
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.
- rename fop.war to fop.zip
- extract the file apex_fop.jsp
- 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
- before the "driver.run();" line add
out = pageContext.pushBody();
- update now the jsp in the fop.zip file
- rename the zip file to war file and deploy in to your server (for example glassfish)
- 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).