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