[634c636c] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[634c636c] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY fop-download-http "http://www.apache.org/dist/xml/fop/fop-&fop-version;-src.tar.gz">
|
---|
| 8 | <!ENTITY fop-download-ftp "ftp://apache.mirrors.pair.com/xml/fop/source/fop-&fop-version;-src.tar.gz">
|
---|
| 9 | <!ENTITY fop-md5sum "1a31eb1357e5d4b8d32d4cb3edae2da2">
|
---|
| 10 | <!ENTITY fop-size "7.8 MB">
|
---|
| 11 | <!ENTITY fop-buildsize "45.3 MB">
|
---|
| 12 | <!ENTITY fop-time "0.25 SBU">
|
---|
[460e986] | 13 |
|
---|
| 14 | <!ENTITY jai-download "http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=jai-1_1_2_01-oth-JPR&SiteId=JSC&TransactionId=noreg">
|
---|
| 15 | <!ENTITY jai-md5sum "f2be3619a8d002eff3874355e96327eb">
|
---|
| 16 | <!ENTITY jai-size "2.6 MB">
|
---|
[634c636c] | 17 | ]>
|
---|
| 18 |
|
---|
[cef3a2f] | 19 | <sect1 id="fop" xreflabel="FOP-&fop-version;">
|
---|
[634c636c] | 20 | <sect1info>
|
---|
| 21 | <othername>$LastChangedBy$</othername>
|
---|
| 22 | <date>$Date$</date>
|
---|
| 23 | </sect1info>
|
---|
| 24 | <?dbhtml filename="fop.html"?>
|
---|
| 25 | <title><application><acronym>FOP</acronym></application>-&fop-version;</title>
|
---|
[cef3a2f] | 26 | <indexterm zone="fop">
|
---|
| 27 | <primary sortas="a-FOP">FOP</primary></indexterm>
|
---|
[634c636c] | 28 |
|
---|
| 29 | <sect2>
|
---|
| 30 | <title>Introduction to <application><acronym>FOP</acronym></application></title>
|
---|
| 31 |
|
---|
| 32 | <para>The <application><acronym>FOP</acronym></application> (Formatting
|
---|
| 33 | Objects Processor) package contains a print formatter driven by
|
---|
| 34 | <acronym>XSL</acronym> formatting objects
|
---|
| 35 | (<acronym>XSL</acronym>-<acronym>FO</acronym>). It is a
|
---|
| 36 | <application>Java</application> application that reads a formatting object
|
---|
| 37 | tree and renders the resulting pages to a specified output. Output formats
|
---|
| 38 | currently supported include <acronym>PDF</acronym>, <acronym>PCL</acronym>,
|
---|
| 39 | PostScript, <acronym>SVG</acronym>, <acronym>XML</acronym> (area tree
|
---|
| 40 | representation), print, <acronym>AWT</acronym>, <acronym>MIF</acronym> and
|
---|
| 41 | <acronym>ASCII</acronym> text. The primary output target is
|
---|
| 42 | <acronym>PDF</acronym>.</para>
|
---|
| 43 |
|
---|
| 44 | <sect3><title>Package information</title>
|
---|
| 45 | <itemizedlist spacing="compact">
|
---|
| 46 | <listitem><para>Download (HTTP):
|
---|
| 47 | <ulink url="&fop-download-http;"/></para></listitem>
|
---|
| 48 | <listitem><para>Download (FTP):
|
---|
| 49 | <ulink url="&fop-download-ftp;"/></para></listitem>
|
---|
| 50 | <listitem><para>Download MD5 sum:
|
---|
| 51 | &fop-md5sum;</para></listitem>
|
---|
| 52 | <listitem><para>Download size:
|
---|
| 53 | &fop-size;</para></listitem>
|
---|
| 54 | <listitem><para>Estimated disk space required:
|
---|
| 55 | &fop-buildsize;</para></listitem>
|
---|
| 56 | <listitem><para>Estimated build time:
|
---|
| 57 | &fop-time;</para></listitem></itemizedlist>
|
---|
| 58 | </sect3>
|
---|
| 59 |
|
---|
| 60 | <sect3><title>Additional downloads</title>
|
---|
[b9d85e6c] | 61 | <sect4><title>Required package</title>
|
---|
[634c636c] | 62 | <itemizedlist spacing="compact">
|
---|
| 63 | <listitem><para><application>Java</application> Advanced Imaging
|
---|
[460e986] | 64 | (<acronym>JAI</acronym>) <acronym>API</acronym> components:
|
---|
| 65 | <ulink url="&jai-download;">
|
---|
[634c636c] | 66 | http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&</ulink>
|
---|
[460e986] | 67 | <ulink url="&jai-download;">
|
---|
| 68 | PartDetailId=jai-1_1_2_01-oth-JPR&SiteId=JSC&TransactionId=noreg</ulink>
|
---|
| 69 | </para></listitem>
|
---|
[1879b5d] | 70 | <listitem><para>Download MD5 sum: &jai-md5sum;</para></listitem>
|
---|
[460e986] | 71 | <listitem><para>Download size: &jai-size;</para></listitem>
|
---|
[1879b5d] | 72 | </itemizedlist>
|
---|
[460e986] | 73 |
|
---|
[634c636c] | 74 | <para>Choose the <quote><application>Linux</application>
|
---|
| 75 | <application><acronym>JDK</acronym></application> Install</quote> file after
|
---|
| 76 | accepting the license agreement.</para>
|
---|
[b9d85e6c] | 77 | </sect4>
|
---|
| 78 |
|
---|
| 79 | <sect4><title>Required patch</title>
|
---|
| 80 | <itemizedlist spacing='compact'>
|
---|
| 81 | <listitem><para><ulink
|
---|
| 82 | url="&patch-root;/fop_&fop-version;-jdk_&jdk-src-version;-1.patch"/></para>
|
---|
| 83 | </listitem>
|
---|
| 84 | </itemizedlist>
|
---|
| 85 | </sect4>
|
---|
[634c636c] | 86 | </sect3>
|
---|
| 87 |
|
---|
| 88 | <sect3><title><application>FOP</application> dependencies</title>
|
---|
| 89 | <sect4><title>Required</title>
|
---|
[5f0bab7] | 90 | <para><xref linkend="jdk"/></para>
|
---|
[634c636c] | 91 | </sect4>
|
---|
| 92 |
|
---|
| 93 | <sect4><title>Optional</title>
|
---|
| 94 | <para><xref linkend="libxslt"/>,
|
---|
| 95 | <ulink url="http://java.sun.com/products/jimi/">JIMI SDK</ulink>,
|
---|
| 96 | <ulink url="http://xml.apache.org/batik/">Batik</ulink> and
|
---|
| 97 | <ulink url="http://forrest.apache.org/">Forrest</ulink> (only used to rebuild
|
---|
| 98 | the documentation)</para>
|
---|
| 99 | </sect4>
|
---|
| 100 | </sect3>
|
---|
| 101 |
|
---|
| 102 | </sect2>
|
---|
| 103 |
|
---|
| 104 | <sect2>
|
---|
| 105 | <title>Installation of <application>FOP</application></title>
|
---|
| 106 |
|
---|
[b9d85e6c] | 107 | <note><para>Ensure <envar>$JAVA_HOME</envar> is set correctly before beginning
|
---|
| 108 | the build.</para></note>
|
---|
| 109 |
|
---|
[634c636c] | 110 | <para>Some versions of tar will display a message similar to
|
---|
| 111 | <quote><computeroutput>tar: A lone zero block at 33476</computeroutput></quote>
|
---|
| 112 | when unpacking the source tarball. You may safely ignore this message.</para>
|
---|
| 113 |
|
---|
| 114 | <sect3><title>Installing <acronym>JAI</acronym></title>
|
---|
| 115 | <para>Install the <acronym>JAI</acronym> components by running the following
|
---|
[d260aaf4] | 116 | commands as the root user while in the root of the
|
---|
[634c636c] | 117 | <application><acronym>FOP</acronym></application> source tree:</para>
|
---|
| 118 |
|
---|
[d260aaf4] | 119 | <screen><userinput role='root'><command>chmod 755 ../jai-1_1_2_01-lib-linux-i586-jdk.bin &&
|
---|
[634c636c] | 120 | FOP_BUILD_DIR=$(pwd) &&
|
---|
| 121 | cd $JAVA_HOME &&
|
---|
| 122 | yes | $FOP_BUILD_DIR/../jai-1_1_2_01-lib-linux-i586-jdk.bin &&
|
---|
| 123 | cd $FOP_BUILD_DIR</command></userinput></screen>
|
---|
| 124 | </sect3>
|
---|
| 125 |
|
---|
| 126 | <sect3><title>Installing <application><acronym>FOP</acronym></application>
|
---|
| 127 | required components</title>
|
---|
| 128 | <para>Install <application><acronym>FOP</acronym></application> by running the
|
---|
| 129 | following commands:</para>
|
---|
| 130 |
|
---|
[5f0bab7] | 131 | <screen><userinput><command>patch -Np1 -i ../fop_&fop-version;-jdk_&jdk-src-version;-1.patch &&
|
---|
| 132 | ./build.sh &&
|
---|
[d260aaf4] | 133 | sed -i -e "s/build/lib/" fop.sh</command></userinput></screen>
|
---|
| 134 |
|
---|
| 135 | <para>Now, as the root user:</para>
|
---|
| 136 |
|
---|
| 137 | <screen><userinput role='root'><command>install -v -d -m755 \
|
---|
[634c636c] | 138 | /opt/fop-&fop-version;/{bin,lib,docs/{general,lib,site}} &&
|
---|
| 139 | install -v -m755 fop.sh /opt/fop-&fop-version;/bin &&
|
---|
| 140 | install -v -m644 build/fop.jar lib/avalon-framework-cvs-20020806.jar \
|
---|
| 141 | /opt/fop-&fop-version;/lib &&
|
---|
| 142 | install -v -m644 docs/* /opt/fop-&fop-version;/docs &&
|
---|
| 143 | install -v -m644 CHANGES LICENSE README ReleaseNotes.html STATUS \
|
---|
| 144 | /opt/fop-&fop-version;/docs/general &&
|
---|
| 145 | install -v -m644 lib/{avalon.LICENSE.txt,readme} \
|
---|
| 146 | /opt/fop-&fop-version;/docs/lib &&
|
---|
| 147 | cp -v -R build/site/* /opt/fop-&fop-version;/docs/site &&
|
---|
| 148 | ln -svf fop-&fop-version; /opt/fop</command></userinput></screen>
|
---|
| 149 | </sect3>
|
---|
| 150 |
|
---|
| 151 | <sect3><title>Installing the <application>Batik</application>
|
---|
| 152 | <acronym>JAR</acronym></title>
|
---|
| 153 | <para>You'll need to install one additional <application>Java</application>
|
---|
| 154 | class library to process <acronym>SVG</acronym> objects. This library is part
|
---|
| 155 | of the <ulink url="http://xml.apache.org/batik/">Batik</ulink> package, but is
|
---|
| 156 | also included with the <application><acronym>FOP</acronym></application>
|
---|
| 157 | package. If you have <application>Batik</application> installed, ensure the
|
---|
| 158 | <filename>batik.jar</filename> library is included in your
|
---|
| 159 | <envar>$CLASSPATH</envar> environment variable. Alternatively, create a
|
---|
| 160 | symbolic link from <filename>/opt/fop-&fop-version;/lib/batik.jar</filename>
|
---|
| 161 | pointing to the full path of the installed <filename>batik.jar</filename>
|
---|
| 162 | file so that the <command>fop.sh</command> script will automatically pick it
|
---|
| 163 | up.</para>
|
---|
| 164 |
|
---|
| 165 | <para>If you don't have the <application>Batik</application> package installed,
|
---|
[d260aaf4] | 166 | run the following commands as the root user:</para>
|
---|
[634c636c] | 167 |
|
---|
[d260aaf4] | 168 | <screen><userinput role='root'><command>install -v -m644 lib/batik.jar /opt/fop-&fop-version;/lib &&
|
---|
[634c636c] | 169 | install -v -m644 lib/batik.LICENSE.txt \
|
---|
| 170 | /opt/fop-&fop-version;/docs/lib</command></userinput></screen>
|
---|
| 171 | </sect3>
|
---|
| 172 |
|
---|
| 173 | <sect3><title>Installing the <application>Xalan-Java</application>
|
---|
| 174 | components</title>
|
---|
| 175 | <para>The components of <application><acronym>FOP</acronym></application>
|
---|
| 176 | required to process <acronym>FO</acronym> files created by an
|
---|
| 177 | <acronym>XSL</acronym> transformation engine (also known as an
|
---|
| 178 | <acronym>XSLT</acronym> processor) is now complete. An
|
---|
| 179 | <acronym>XSL</acronym> transformation engine (<command>xsltproc</command>)
|
---|
| 180 | is included with the <xref linkend="libxslt"/> package in
|
---|
| 181 | <acronym>BLFS</acronym>. The <application><acronym>FOP</acronym></application>
|
---|
| 182 | package includes components of
|
---|
| 183 | <ulink url="http://xml.apache.org/xalan-j/">Xalan-Java</ulink> to accomplish
|
---|
| 184 | <acronym>XSL</acronym> transformations. If you have the
|
---|
| 185 | <application>Xalan-Java</application> package installed, skip to the next
|
---|
| 186 | section.</para>
|
---|
| 187 |
|
---|
| 188 | <para>If you wish to install the <application>Xalan-Java</application>
|
---|
| 189 | components provided by the <application><acronym>FOP</acronym></application>
|
---|
[d260aaf4] | 190 | package, run the following commands as the root user:</para>
|
---|
[634c636c] | 191 |
|
---|
[d260aaf4] | 192 | <screen><userinput role='root'><command>sed -i -e "s/build/lib/" xalan.sh &&
|
---|
[634c636c] | 193 | install -v -m755 xalan.sh /opt/fop-&fop-version;/bin &&
|
---|
| 194 | install -v -m644 lib/xml-apis.jar \
|
---|
| 195 | lib/xercesImpl-2.2.1.jar \
|
---|
| 196 | lib/xalan-2.4.1.jar \
|
---|
| 197 | /opt/fop-&fop-version;/lib &&
|
---|
| 198 | install -v -m644 lib/{xml-apis,xerces,xalan}.LICENSE.txt \
|
---|
| 199 | lib/xml-apis.README.txt \
|
---|
| 200 | /opt/fop-&fop-version;/docs/lib</command></userinput></screen>
|
---|
| 201 | </sect3>
|
---|
| 202 |
|
---|
| 203 | <sect3><title>Installing the
|
---|
| 204 | <application>Jimi <acronym>SDK</acronym></application>
|
---|
| 205 | <acronym>JAR</acronym></title>
|
---|
| 206 | <para>If you installed the Java Image I/O class library
|
---|
| 207 | (<application>Jimi <acronym>SDK</acronym></application>) into the
|
---|
| 208 | <application><acronym>FOP</acronym></application> source tree
|
---|
| 209 | <filename class='directory'>lib</filename> directory before building
|
---|
| 210 | <application><acronym>FOP</acronym></application> (this will enable Jimi
|
---|
| 211 | support), ensure you also install this <acronym>JAR</acronym> file into
|
---|
| 212 | <filename class='directory'>/opt/fop-&fop-version;/lib</filename>.</para>
|
---|
| 213 | </sect3>
|
---|
| 214 |
|
---|
| 215 | </sect2>
|
---|
| 216 |
|
---|
| 217 | <sect2>
|
---|
| 218 | <title>Command explanations</title>
|
---|
| 219 |
|
---|
| 220 | <para><command>yes | $FOP_BUILD_DIR/../jai-...-jdk.bin</command>: This command
|
---|
| 221 | installs the <application><acronym>JAI</acronym></application> components
|
---|
| 222 | into the <application><acronym>JDK</acronym></application> file structure. The
|
---|
| 223 | <command>yes</command> command is piped through so that you don't have to
|
---|
| 224 | scroll through four pages of the license agreement and automatically responds
|
---|
| 225 | <quote>yes</quote> to the agreement. <envar>$FOP_BUILD_DIR</envar> is used as
|
---|
| 226 | a reference point to the source executable and as a method to return back to
|
---|
| 227 | the <application><acronym>FOP</acronym></application> source tree.</para>
|
---|
| 228 |
|
---|
| 229 | <para><command>sed -i -e "s/build/lib/" ...</command>: These commands modify
|
---|
| 230 | the installed shell scripts so that the location of the installed
|
---|
| 231 | <filename>fop.jar</filename> file is correctly identified.</para>
|
---|
| 232 |
|
---|
| 233 | <para><command>install -v ...; cp -v ...</command>: There is no installation
|
---|
| 234 | script provided by the <application><acronym>FOP</acronym></application>
|
---|
| 235 | package. These commands install the package.</para>
|
---|
| 236 |
|
---|
| 237 | <para><command>ln -svf fop-&fop-version; /opt/fop</command>: This creates a
|
---|
| 238 | convenience symlink so that <envar>$FOP_HOME</envar> doesn't have to be
|
---|
| 239 | changed each time there's a package version change.</para>
|
---|
| 240 | </sect2>
|
---|
| 241 |
|
---|
| 242 | <sect2>
|
---|
| 243 | <title>Configuring <application>FOP</application></title>
|
---|
| 244 |
|
---|
[40851cf] | 245 | <sect3 id="fop-config"><title>Config files</title>
|
---|
| 246 | <para><filename>~/.foprc</filename></para>
|
---|
[cef3a2f] | 247 | <indexterm zone="fop fop-config">
|
---|
[0cd6d67] | 248 | <primary sortas="e-AA.foprc">~/.foprc</primary></indexterm>
|
---|
[634c636c] | 249 | </sect3>
|
---|
| 250 |
|
---|
| 251 | <sect3><title>Configuration Information</title>
|
---|
| 252 |
|
---|
| 253 | <para>Using <application><acronym>FOP</acronym></application> to process some
|
---|
| 254 | large <acronym>FO</acronym>'s (including the <acronym>FO</acronym> derived from
|
---|
| 255 | the <acronym>BLFS</acronym> <acronym>XML</acronym> sources), can lead to memory
|
---|
| 256 | errors. Unless you add a parameter to the <command>java</command> command used
|
---|
| 257 | in the <command>fop.sh</command> script you may receive messages similar to the
|
---|
| 258 | one shown below:</para>
|
---|
| 259 |
|
---|
| 260 | <para><computeroutput>Exception in thread "main" java.lang.OutOfMemoryError:
|
---|
| 261 | Java heap space</computeroutput></para>
|
---|
| 262 |
|
---|
| 263 | <para>To avoid errors like this, you need to pass an extra parameter to the
|
---|
| 264 | <command>java</command> command used in the <command>fop.sh</command> script.
|
---|
| 265 | This can be accomplished by creating a <filename>~/.foprc</filename> (which
|
---|
| 266 | is sourced by the <command>fop.sh</command> script) and adding the parameter
|
---|
| 267 | to the <envar>FOP_OPTS</envar> environment variable.</para>
|
---|
| 268 |
|
---|
| 269 | <para>The <command>fop.sh</command> script looks for a <envar>FOP_HOME</envar>
|
---|
| 270 | environment variable to locate the
|
---|
| 271 | <application><acronym>FOP</acronym></application> class libraries. You can
|
---|
| 272 | create this variable using the <filename>~/.foprc</filename> file as
|
---|
| 273 | well. Create a <filename>~/.foprc</filename> file using the following
|
---|
| 274 | commands:</para>
|
---|
| 275 |
|
---|
| 276 | <screen><userinput><command>cat > ~/.foprc << "EOF"</command>
|
---|
| 277 | FOP_OPTS="-Xmx<replaceable>[RAM_Installed]</replaceable>m"
|
---|
| 278 | FOP_HOME="/opt/fop"
|
---|
| 279 |
|
---|
| 280 | <command>EOF</command></userinput></screen>
|
---|
| 281 |
|
---|
| 282 | <para>Replace <replaceable>[RAM_Installed]</replaceable> with a number
|
---|
| 283 | representing the amount of RAM installed in your computer. An example would
|
---|
| 284 | be <userinput>FOP_OPTS="-Xmx768m"</userinput>. For more information about
|
---|
| 285 | memory issues running <application><acronym>FOP</acronym></application>, see
|
---|
| 286 | <ulink url="http://xml.apache.org/fop/running.html#memory"/>.</para>
|
---|
| 287 |
|
---|
| 288 | <para>To include the <command>fop.sh</command> script in your path, update
|
---|
| 289 | your personal or system-wide profile with the following:</para>
|
---|
| 290 |
|
---|
| 291 | <screen><userinput>PATH=$PATH:/opt/fop/bin</userinput></screen>
|
---|
| 292 | </sect3>
|
---|
| 293 |
|
---|
| 294 | </sect2>
|
---|
| 295 |
|
---|
| 296 | <sect2>
|
---|
| 297 | <title>Contents</title>
|
---|
| 298 |
|
---|
| 299 | <segmentedlist>
|
---|
| 300 | <segtitle>Installed Programs</segtitle>
|
---|
| 301 | <segtitle>Installed Libraries</segtitle>
|
---|
| 302 | <segtitle>Installed Directory</segtitle>
|
---|
| 303 | <seglistitem>
|
---|
| 304 | <seg>fop.sh and xalan.sh</seg>
|
---|
| 305 | <seg>avalon-framework-cvs-20020806.jar, batik.jar, fop.jar, xalan-2.4.1.jar,
|
---|
| 306 | xercesImpl-2.2.1.jar and xml-apis.jar. <acronym>JAI</acronym> components
|
---|
| 307 | include libmlib_jai.so, jai_codec.jar, jai_core.jar and
|
---|
| 308 | mlibwrapper_jai.jar</seg>
|
---|
| 309 | <seg>/opt/fop-&fop-version;</seg>
|
---|
| 310 | </seglistitem>
|
---|
| 311 | </segmentedlist>
|
---|
| 312 |
|
---|
| 313 | <variablelist>
|
---|
| 314 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 315 | <?dbfo list-presentation="list"?>
|
---|
| 316 |
|
---|
| 317 | <varlistentry id="fop.sh">
|
---|
| 318 | <term><command>fop.sh</command></term>
|
---|
| 319 | <listitem><para>is a wrapper script to the <command>java</command> command
|
---|
| 320 | which sets up the <application><acronym>FOP</acronym></application>
|
---|
| 321 | environment and passes the required parameters.</para>
|
---|
[cef3a2f] | 322 | <indexterm zone="fop fop.sh">
|
---|
[634c636c] | 323 | <primary sortas="b-fop.sh">fop.sh</primary></indexterm>
|
---|
| 324 | </listitem>
|
---|
| 325 | </varlistentry>
|
---|
| 326 |
|
---|
| 327 | <varlistentry id="fop.jar">
|
---|
| 328 | <term><filename class='libraryfile'>fop.jar</filename></term>
|
---|
| 329 | <listitem><para>contains all the
|
---|
| 330 | <application><acronym>FOP</acronym></application>
|
---|
| 331 | <application>Java</application> classes.</para>
|
---|
[cef3a2f] | 332 | <indexterm zone="fop fop.jar">
|
---|
[634c636c] | 333 | <primary sortas="c-fop.jar">fop.jar</primary></indexterm>
|
---|
| 334 | </listitem>
|
---|
| 335 | </varlistentry>
|
---|
| 336 | </variablelist>
|
---|
| 337 |
|
---|
| 338 | </sect2>
|
---|
| 339 |
|
---|
| 340 | </sect1>
|
---|
| 341 |
|
---|