%general-entities; ]> $LastChangedBy$ $Date$ <application><acronym>FOP</acronym></application>-&fop-version; FOP Introduction to <application><acronym>FOP</acronym></application> The FOP (Formatting Objects Processor) package contains a print formatter driven by XSL formatting objects (XSL-FO). It is a Java application that reads a formatting object tree and renders the resulting pages to a specified output. Output formats currently supported include PDF, PCL, PostScript, SVG, XML (area tree representation), print, AWT, MIF and ASCII text. The primary output target is PDF. Package information Download (HTTP): Download (FTP): Download MD5 sum: &fop-md5sum; Download size: &fop-size; Estimated disk space required: &fop-buildsize; Estimated build time: &fop-time; Additional downloads Java Advanced Imaging (JAI) API components: http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22& PartDetailId=jai-1_1_2_01-oth-JPR&SiteId=JSC&TransactionId=noreg Choose the Linux JDK Install file after accepting the license agreement. <application>FOP</application> dependencies Required Optional , JIMI SDK, Batik and Forrest (only used to rebuild the documentation) Installation of <application>FOP</application> Ensure $JAVA_HOME is set correctly before beginning the build. Additionally, the build will fail if your version of the JDK is higher than 1.4.2_x. Some versions of tar will display a message similar to tar: A lone zero block at 33476 when unpacking the source tarball. You may safely ignore this message. Installing <acronym>JAI</acronym> Install the JAI components by running the following commands while in the root of the FOP source tree: chmod 755 ../jai-1_1_2_01-lib-linux-i586-jdk.bin && FOP_BUILD_DIR=$(pwd) && cd $JAVA_HOME && yes | $FOP_BUILD_DIR/../jai-1_1_2_01-lib-linux-i586-jdk.bin && cd $FOP_BUILD_DIR Installing <application><acronym>FOP</acronym></application> required components Install FOP by running the following commands: ./build.sh && sed -i -e "s/build/lib/" fop.sh && install -v -d -m755 \ /opt/fop-&fop-version;/{bin,lib,docs/{general,lib,site}} && install -v -m755 fop.sh /opt/fop-&fop-version;/bin && install -v -m644 build/fop.jar lib/avalon-framework-cvs-20020806.jar \ /opt/fop-&fop-version;/lib && install -v -m644 docs/* /opt/fop-&fop-version;/docs && install -v -m644 CHANGES LICENSE README ReleaseNotes.html STATUS \ /opt/fop-&fop-version;/docs/general && install -v -m644 lib/{avalon.LICENSE.txt,readme} \ /opt/fop-&fop-version;/docs/lib && cp -v -R build/site/* /opt/fop-&fop-version;/docs/site && ln -svf fop-&fop-version; /opt/fop Installing the <application>Batik</application> <acronym>JAR</acronym> You'll need to install one additional Java class library to process SVG objects. This library is part of the Batik package, but is also included with the FOP package. If you have Batik installed, ensure the batik.jar library is included in your $CLASSPATH environment variable. Alternatively, create a symbolic link from /opt/fop-&fop-version;/lib/batik.jar pointing to the full path of the installed batik.jar file so that the fop.sh script will automatically pick it up. If you don't have the Batik package installed, run the following commands: install -v -m644 lib/batik.jar /opt/fop-&fop-version;/lib && install -v -m644 lib/batik.LICENSE.txt \ /opt/fop-&fop-version;/docs/lib Installing the <application>Xalan-Java</application> components The components of FOP required to process FO files created by an XSL transformation engine (also known as an XSLT processor) is now complete. An XSL transformation engine (xsltproc) is included with the package in BLFS. The FOP package includes components of Xalan-Java to accomplish XSL transformations. If you have the Xalan-Java package installed, skip to the next section. If you wish to install the Xalan-Java components provided by the FOP package, run the following commands: sed -i -e "s/build/lib/" xalan.sh && install -v -m755 xalan.sh /opt/fop-&fop-version;/bin && install -v -m644 lib/xml-apis.jar \ lib/xercesImpl-2.2.1.jar \ lib/xalan-2.4.1.jar \ /opt/fop-&fop-version;/lib && install -v -m644 lib/{xml-apis,xerces,xalan}.LICENSE.txt \ lib/xml-apis.README.txt \ /opt/fop-&fop-version;/docs/lib Installing the <application>Jimi <acronym>SDK</acronym></application> <acronym>JAR</acronym> If you installed the Java Image I/O class library (Jimi SDK) into the FOP source tree lib directory before building FOP (this will enable Jimi support), ensure you also install this JAR file into /opt/fop-&fop-version;/lib. Command explanations yes | $FOP_BUILD_DIR/../jai-...-jdk.bin: This command installs the JAI components into the JDK file structure. The yes command is piped through so that you don't have to scroll through four pages of the license agreement and automatically responds yes to the agreement. $FOP_BUILD_DIR is used as a reference point to the source executable and as a method to return back to the FOP source tree. sed -i -e "s/build/lib/" ...: These commands modify the installed shell scripts so that the location of the installed fop.jar file is correctly identified. install -v ...; cp -v ...: There is no installation script provided by the FOP package. These commands install the package. ln -svf fop-&fop-version; /opt/fop: This creates a convenience symlink so that $FOP_HOME doesn't have to be changed each time there's a package version change. Configuring <application>FOP</application> Config files ~/.foprc ~/.foprc Configuration Information Using FOP to process some large FO's (including the FO derived from the BLFS XML sources), can lead to memory errors. Unless you add a parameter to the java command used in the fop.sh script you may receive messages similar to the one shown below: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space To avoid errors like this, you need to pass an extra parameter to the java command used in the fop.sh script. This can be accomplished by creating a ~/.foprc (which is sourced by the fop.sh script) and adding the parameter to the FOP_OPTS environment variable. The fop.sh script looks for a FOP_HOME environment variable to locate the FOP class libraries. You can create this variable using the ~/.foprc file as well. Create a ~/.foprc file using the following commands: cat > ~/.foprc << "EOF" FOP_OPTS="-Xmx[RAM_Installed]m" FOP_HOME="/opt/fop" EOF Replace [RAM_Installed] with a number representing the amount of RAM installed in your computer. An example would be FOP_OPTS="-Xmx768m". For more information about memory issues running FOP, see . To include the fop.sh script in your path, update your personal or system-wide profile with the following: PATH=$PATH:/opt/fop/bin Contents Installed Programs Installed Libraries Installed Directory fop.sh and xalan.sh avalon-framework-cvs-20020806.jar, batik.jar, fop.jar, xalan-2.4.1.jar, xercesImpl-2.2.1.jar and xml-apis.jar. JAI components include libmlib_jai.so, jai_codec.jar, jai_core.jar and mlibwrapper_jai.jar /opt/fop-&fop-version; Short Descriptions fop.sh is a wrapper script to the java command which sets up the FOP environment and passes the required parameters. fop.sh fop.jar contains all the FOP Java classes. fop.jar