Setting the environment
We need to download the FOP JAR file fop-0.20.5-bin.zip
(or a later version) from http://archive.apache.org/dist/xmlgraphics/fop/binaries/ and extract the ZIP file to a directory. To develop an XML-to-PDF conversion application, we need to create an application (ApacheFOP for example) and a project (ApacheFOP for example) in JDeveloper. In the project add an XML document, catalog.xml
, with File|New. In the New Gallery window select Categories|General|XML and Items|XML Document. Click on OK. In the Create XML File window specify a File Name, catalog.xml
, and click on OK. A catalog.xml file gets added to the ApacheFOP project. Copy the following catalog.xml
listing to catalog.xml:
<?xml version="1.0" encoding="UTF-8"?> <catalog title="Oracle Magazine" publisher="Oracle Publishing"> <journal edition="September-October 2008"> <article> <title>Share 2.0</title> <author>Alan Joch</author> </article> <article>...