[634c636c] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[634c636c] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[d0151ee] | 7 | <!ENTITY fop-download-http "http://archive.apache.org/dist/xmlgraphics/fop/source/fop-&fop-version;-src.tar.gz">
|
---|
| 8 | <!-- <!ENTITY fop-download-ftp "ftp://apache.mirrors.pair.com/xmlgraphics/fop/fop-&fop-version;-src.tar.gz"> -->
|
---|
| 9 | <!ENTITY fop-download-ftp "&sources-anduin-ftp;/f/fop-&fop-version;-src.tar.gz">
|
---|
[48bd327] | 10 | <!ENTITY fop-md5sum "95dcc4c2dd08b4bc88ce9ce1ee88c439">
|
---|
| 11 | <!ENTITY fop-size "16.1 MB">
|
---|
| 12 | <!ENTITY fop-buildsize "360 MB">
|
---|
| 13 | <!ENTITY fop-time "2.8 SBU">
|
---|
[460e986] | 14 |
|
---|
[50cc5ad] | 15 | <!ENTITY jai-version "1_1_3">
|
---|
| 16 | <!ENTITY jai-download "http://download.java.net/media/jai/builds/release/&jai-version;/jai-&jai-version;-lib-linux-i586-jdk.bin">
|
---|
| 17 | <!ENTITY jai-md5sum "a63b661c4940582aa1679233e5f518b2">
|
---|
| 18 | <!ENTITY jai-size "3.4 MB">
|
---|
[492000e] | 19 |
|
---|
[48bd327] | 20 | <!ENTITY offo-download "&sourceforge-repo;/offo/offo-hyphenation_v2.0.zip">
|
---|
| 21 | <!ENTITY offo-md5sum "a78171d47c9af223c51bbd42df36f26d">
|
---|
| 22 | <!ENTITY offo-size "858 KB">
|
---|
[634c636c] | 23 | ]>
|
---|
| 24 |
|
---|
[cef3a2f] | 25 | <sect1 id="fop" xreflabel="FOP-&fop-version;">
|
---|
[f570280] | 26 | <?dbhtml filename="fop.html"?>
|
---|
| 27 |
|
---|
| 28 | <sect1info>
|
---|
| 29 | <othername>$LastChangedBy$</othername>
|
---|
| 30 | <date>$Date$</date>
|
---|
| 31 | </sect1info>
|
---|
| 32 |
|
---|
| 33 | <title>FOP-&fop-version;</title>
|
---|
| 34 |
|
---|
| 35 | <indexterm zone="fop">
|
---|
| 36 | <primary sortas="a-FOP">FOP</primary>
|
---|
| 37 | </indexterm>
|
---|
| 38 |
|
---|
| 39 | <sect2 role="package">
|
---|
| 40 | <title>Introduction to FOP</title>
|
---|
| 41 |
|
---|
| 42 | <para>The <application>FOP</application> (Formatting Objects Processor)
|
---|
| 43 | package contains a print formatter driven by XSL formatting objects
|
---|
| 44 | (XSL-FO). It is a <application>Java</application> application that reads
|
---|
| 45 | a formatting object tree and renders the resulting pages to a specified
|
---|
| 46 | output. Output formats currently supported include PDF, PCL, PostScript,
|
---|
| 47 | SVG, XML (area tree representation), print, AWT, MIF and ASCII text. The
|
---|
| 48 | primary output target is PDF.</para>
|
---|
| 49 |
|
---|
[50929e8] | 50 | <para>&lfssvn_checked;20101029&lfssvn_checked2;</para>
|
---|
| 51 |
|
---|
[f570280] | 52 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 53 | <itemizedlist spacing="compact">
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>Download (HTTP): <ulink url="&fop-download-http;"/></para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>Download (FTP): <ulink url="&fop-download-ftp;"/></para>
|
---|
| 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
| 61 | <para>Download MD5 sum: &fop-md5sum;</para>
|
---|
| 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
| 64 | <para>Download size: &fop-size;</para>
|
---|
| 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
| 67 | <para>Estimated disk space required: &fop-buildsize;</para>
|
---|
| 68 | </listitem>
|
---|
| 69 | <listitem>
|
---|
| 70 | <para>Estimated build time: &fop-time;</para>
|
---|
| 71 | </listitem>
|
---|
| 72 | </itemizedlist>
|
---|
| 73 |
|
---|
| 74 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 75 |
|
---|
| 76 | <itemizedlist spacing="compact">
|
---|
[492000e] | 77 | <title>Required packages</title>
|
---|
[f570280] | 78 | <listitem>
|
---|
[492000e] | 79 | <para>Objects for Formatting Objects (OFFO) hyphenation patterns:
|
---|
| 80 | <simplelist>
|
---|
| 81 | <member><ulink url="&offo-download;"/></member>
|
---|
| 82 | <member>&offo-md5sum;</member>
|
---|
| 83 | <member>&offo-size;</member>
|
---|
| 84 | </simplelist>
|
---|
[f570280] | 85 | </para>
|
---|
| 86 | </listitem>
|
---|
| 87 | <listitem>
|
---|
[492000e] | 88 | <para>Java Advanced Imaging (JAI) API components:
|
---|
| 89 | <simplelist>
|
---|
[50cc5ad] | 90 | <member><ulink url="&jai-download;"/></member>
|
---|
[492000e] | 91 | <member>&jai-md5sum;</member>
|
---|
| 92 | <member>&jai-size;</member>
|
---|
| 93 | </simplelist>
|
---|
| 94 | </para>
|
---|
[f570280] | 95 | </listitem>
|
---|
| 96 | </itemizedlist>
|
---|
| 97 |
|
---|
[492000e] | 98 | <!-- <itemizedlist spacing='compact'>
|
---|
[f570280] | 99 | <title>Required patch</title>
|
---|
| 100 | <listitem>
|
---|
| 101 | <para><ulink
|
---|
[829c2191] | 102 | url="&patch-root;/fop-&fop-version;-jdk_1.5.0-1.patch"/></para>
|
---|
[f570280] | 103 | </listitem>
|
---|
[492000e] | 104 | </itemizedlist> -->
|
---|
[f570280] | 105 |
|
---|
| 106 | <bridgehead renderas="sect3">FOP Dependencies</bridgehead>
|
---|
| 107 |
|
---|
| 108 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[8159f350] | 109 | <para role="required"><xref linkend="xorg7"/>,
|
---|
| 110 | <xref linkend="apache-ant"/>, and
|
---|
| 111 | <ulink url="http://java.sun.com/javase/technologies/desktop/media/jai/">Java
|
---|
| 112 | Advanced Imaging (JAI) API components</ulink></para>
|
---|
[f570280] | 113 |
|
---|
| 114 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[492000e] | 115 | <para role="optional"><ulink url="http://java.sun.com/products/jimi/">JIMI SDK</ulink>,
|
---|
[48bd327] | 116 | <ulink url="http://xmlunit.sourceforge.net/">XMLUnit</ulink>,
|
---|
| 117 | <ulink url="https://jai-imageio.dev.java.net/">JAI Image I/O Tools</ulink>,
|
---|
| 118 | <ulink url="http://jeuclid.sourceforge.net/">JEuclid</ulink>,
|
---|
| 119 | <ulink url="http://pmd.sourceforge.net">PMD</ulink>
|
---|
| 120 | (requires <ulink url="http://jaxen.codehaus.org/">Jaxen</ulink>), and
|
---|
| 121 | <ulink url="http://forrest.apache.org/">Forrest</ulink> (Forrest used only
|
---|
| 122 | to rebuild the documentation)</para>
|
---|
[f570280] | 123 |
|
---|
[977061b0] | 124 | <para condition="html" role="usernotes">User Notes:
|
---|
| 125 | <ulink url="&blfs-wiki;/fop"/></para>
|
---|
| 126 |
|
---|
[f570280] | 127 | </sect2>
|
---|
| 128 |
|
---|
| 129 | <sect2 role="installation">
|
---|
| 130 | <title>Installation of FOP</title>
|
---|
| 131 |
|
---|
[48bd327] | 132 | <important>
|
---|
| 133 | <para>You must run this installation from an X-window using a GL-aware
|
---|
| 134 | <application>Xorg</application> server or some of the
|
---|
| 135 | <application>JUnit</application> tests will hang. Using an X-window from
|
---|
| 136 | the console is the preferred method.</para>
|
---|
| 137 | </important>
|
---|
[8159f350] | 138 |
|
---|
[492000e] | 139 | <para>Ensure <envar>$JAVA_HOME</envar> is set correctly before beginning
|
---|
| 140 | the build. To build the <application>JIMI SDK</application> and/or
|
---|
| 141 | <application>XMLUnit</application> extension classes, ensure the
|
---|
| 142 | corresponding <filename class='extension'>.jar</filename> files are
|
---|
| 143 | identified in the <envar>CLASSPATH</envar> environment variable.</para>
|
---|
[f570280] | 144 |
|
---|
[492000e] | 145 | <sect3>
|
---|
| 146 | <title>Installing OFFO Hyphenation Patterns</title>
|
---|
| 147 |
|
---|
| 148 | <para>Before beginning the build, unpack the
|
---|
| 149 | <application>FOP</application> source tarball and the hyphenation zipfile
|
---|
| 150 | from the same directory, then change directories into the root of the
|
---|
[48bd327] | 151 | <application>FOP</application> source tree. Copy the XML hyphenation
|
---|
| 152 | patterns into the <application>FOP</application> source tree by
|
---|
[492000e] | 153 | running the following commands:</para>
|
---|
| 154 |
|
---|
| 155 | <screen><userinput>cp ../offo-hyphenation/hyph/* hyph &&
|
---|
| 156 | rm -rf ../offo-hyphenation</userinput></screen>
|
---|
| 157 |
|
---|
| 158 | </sect3>
|
---|
[f570280] | 159 |
|
---|
| 160 | <sect3>
|
---|
| 161 | <title>Installing JAI</title>
|
---|
| 162 |
|
---|
[d4277d4] | 163 | <tip>
|
---|
[50cc5ad] | 164 | <para>The <command>$FOP_PKG_DIR/jai-&jai-version;-lib-linux-i586-jdk.bin</command>
|
---|
[d4277d4] | 165 | command below installs the JAI components in the JDK tree. You will be
|
---|
| 166 | required to view, and then accept (by entering a <keycap>y</keycap>
|
---|
| 167 | keypress), a license agreement before the installation will continue.
|
---|
| 168 | If you are scripting (automating) the build, you'll need to account for
|
---|
| 169 | this. There is information about automating build commands in the
|
---|
| 170 | <xref linkend="automating-builds"/> section of Chapter 2. Towards the
|
---|
| 171 | end of this section, specific information for automating this type of
|
---|
| 172 | installation is discussed.</para>
|
---|
| 173 | </tip>
|
---|
| 174 |
|
---|
[f570280] | 175 | <para>Install the JAI components by running the following commands as
|
---|
| 176 | the <systemitem class="username">root</systemitem> user while in the
|
---|
| 177 | root of the <application>FOP</application> source tree:</para>
|
---|
| 178 |
|
---|
[50cc5ad] | 179 | <!-- JAI make tail +nnn only for SunOS now
|
---|
| 180 | <screen role="root"><userinput>install -m755 ../jai-&jai-version;-lib-linux-i586-jdk.bin JAI.bin &&
|
---|
[492000e] | 181 | sed -i 's/tail +122/tail -n +122/' JAI.bin &&
|
---|
[50cc5ad] | 182 | -->
|
---|
| 183 | <screen role="root"><userinput>FOP_PKG_DIR=$(pwd)/.. &&
|
---|
| 184 | pushd $JAVA_HOME &&
|
---|
| 185 | sh $FOP_PKG_DIR/jai-&jai-version;-lib-linux-i586-jdk.bin &&
|
---|
| 186 | popd</userinput></screen>
|
---|
[634c636c] | 187 |
|
---|
[f570280] | 188 | </sect3>
|
---|
[634c636c] | 189 |
|
---|
[f570280] | 190 | <sect3>
|
---|
[492000e] | 191 | <title>Installing FOP Components</title>
|
---|
[f570280] | 192 |
|
---|
[48bd327] | 193 | <para>If <application>Forrest</application> is not installed, remove
|
---|
[50cc5ad] | 194 | a reference to it in the build.xml:</para>
|
---|
[48bd327] | 195 |
|
---|
[50cc5ad] | 196 | <screen><userinput>sed -i -e "s/all,javadocs,docs/all,javadocs/" \
|
---|
[48bd327] | 197 | -e '\#${dist.bin.result.dir}/docs#,\#</copy>#d' build.xml</userinput></screen>
|
---|
[50cc5ad] | 198 |
|
---|
| 199 | <para>Compile <application>FOP</application> by running the
|
---|
[f570280] | 200 | following commands:</para>
|
---|
| 201 |
|
---|
[50cc5ad] | 202 | <screen><userinput>ant dist</userinput></screen>
|
---|
[492000e] | 203 |
|
---|
| 204 | <para>The unit regression tests were performed in the build step
|
---|
| 205 | above.</para>
|
---|
[d260aaf4] | 206 |
|
---|
[48bd327] | 207 | <para>Now, as the <systemitem class="username">root</systemitem>
|
---|
| 208 | user:</para>
|
---|
[d260aaf4] | 209 |
|
---|
[48bd327] | 210 | <screen role="root"><userinput>install -v -d -m755 /opt/fop-&fop-version; &&
|
---|
| 211 | mv -v dist-bin/fop-&fop-version;/* /opt/fop-&fop-version; &&
|
---|
[492000e] | 212 | ln -v -sf fop-&fop-version; /opt/fop</userinput></screen>
|
---|
[f570280] | 213 |
|
---|
| 214 | </sect3>
|
---|
| 215 |
|
---|
| 216 | </sect2>
|
---|
[634c636c] | 217 |
|
---|
[f570280] | 218 | <sect2 role="commands">
|
---|
| 219 | <title>Command Explanations</title>
|
---|
| 220 |
|
---|
[91a9ba6] | 221 | <para><command>FOP_PKG_DIR=$(pwd)/..</command>: This assumes that the
|
---|
| 222 | source packages are stored one level above the current working directory.
|
---|
| 223 | This is always the default; but may be different because of personal
|
---|
| 224 | taste. If necessary, change this to match the directory where the
|
---|
| 225 | <application>FOP</application> tarball can be found.</para>
|
---|
[1d3a3fa] | 226 |
|
---|
[48bd327] | 227 | <para><command>sh
|
---|
| 228 | $FOP_PKG_DIR/jai-&jai-version;-lib-linux-i586-jdk.bin</command>: This
|
---|
[f570280] | 229 | command installs the <application>JAI</application> components
|
---|
[d4277d4] | 230 | into the <application>JDK</application> file structure.
|
---|
[50cc5ad] | 231 | <envar>$FOP_PKG_DIR</envar> is used as a reference point to the source
|
---|
| 232 | executable.</para>
|
---|
[f570280] | 233 |
|
---|
[48bd327] | 234 | <para><command>ant dist</command>: This reads the
|
---|
| 235 | <filename>build.xml</filename> file's <option>dist</option> target,
|
---|
| 236 | builds the package and runs the unit regression tests. It also creates the
|
---|
| 237 | Java API documentation and a directory where the newly created binaries
|
---|
| 238 | are placed. This directory is used to install <application>FOP</application>
|
---|
| 239 | into its final place.</para>
|
---|
[f570280] | 240 |
|
---|
[492000e] | 241 | <para><command>ln -v -sf fop-&fop-version; /opt/fop</command>: This is
|
---|
| 242 | optional and creates a convenience symlink so that <envar>$FOP_HOME</envar>
|
---|
| 243 | doesn't have to be changed each time there's a package version change.</para>
|
---|
[f570280] | 244 |
|
---|
| 245 | </sect2>
|
---|
| 246 |
|
---|
| 247 | <sect2 role="configuration">
|
---|
| 248 | <title>Configuring FOP</title>
|
---|
| 249 |
|
---|
| 250 | <sect3 id="fop-config">
|
---|
| 251 | <title>Config Files</title>
|
---|
| 252 |
|
---|
| 253 | <para><filename>~/.foprc</filename></para>
|
---|
| 254 |
|
---|
| 255 | <indexterm zone="fop fop-config">
|
---|
| 256 | <primary sortas="e-AA.foprc">~/.foprc</primary>
|
---|
| 257 | </indexterm>
|
---|
| 258 |
|
---|
| 259 | </sect3>
|
---|
| 260 |
|
---|
| 261 | <sect3>
|
---|
| 262 | <title>Configuration Information</title>
|
---|
| 263 |
|
---|
| 264 | <para>Using <application>FOP</application> to process some large FO's
|
---|
| 265 | (including the FO derived from the BLFS XML sources), can lead to memory
|
---|
| 266 | errors. Unless you add a parameter to the <command>java</command> command
|
---|
[492000e] | 267 | used in the <command>fop</command> script you may receive messages
|
---|
[f570280] | 268 | similar to the one shown below:</para>
|
---|
| 269 |
|
---|
| 270 | <para><computeroutput>Exception in thread "main" java.lang.OutOfMemoryError:
|
---|
| 271 | Java heap space</computeroutput></para>
|
---|
| 272 |
|
---|
[977061b0] | 273 | <para>To avoid errors like this, you need to pass an extra parameter to
|
---|
[492000e] | 274 | the <command>java</command> command used in the <command>fop</command>
|
---|
[977061b0] | 275 | script. This can be accomplished by creating a
|
---|
| 276 | <filename>~/.foprc</filename> (which is sourced by the
|
---|
[492000e] | 277 | <command>fop</command> script) and adding the parameter to the
|
---|
[977061b0] | 278 | <envar>FOP_OPTS</envar> environment variable.</para>
|
---|
[f570280] | 279 |
|
---|
[492000e] | 280 | <para>The <command>fop</command> script looks for a
|
---|
[f570280] | 281 | <envar>FOP_HOME</envar> environment variable to locate the
|
---|
| 282 | <application>FOP</application> class libraries. You can create this
|
---|
| 283 | variable using the <filename>~/.foprc</filename> file as well. Create
|
---|
| 284 | a <filename>~/.foprc</filename> file using the following commands:</para>
|
---|
| 285 |
|
---|
| 286 | <screen><userinput>cat > ~/.foprc << "EOF"
|
---|
[977061b0] | 287 | <literal>FOP_OPTS="-Xmx<replaceable><RAM_Installed></replaceable>m"
|
---|
[f570280] | 288 | FOP_HOME="/opt/fop"</literal>
|
---|
| 289 |
|
---|
| 290 | EOF</userinput></screen>
|
---|
| 291 |
|
---|
[977061b0] | 292 | <para>Replace <replaceable><RAM_Installed></replaceable> with a
|
---|
| 293 | number representing the amount of RAM installed in your computer (in
|
---|
| 294 | megabytes). An example would be
|
---|
| 295 | <userinput>FOP_OPTS="-Xmx768m"</userinput>. For more information about
|
---|
[f570280] | 296 | memory issues running <application>FOP</application>, see
|
---|
| 297 | <ulink url="http://xml.apache.org/fop/running.html#memory"/>.</para>
|
---|
| 298 |
|
---|
[492000e] | 299 | <para>To include the <command>fop</command> script in your path,
|
---|
[977061b0] | 300 | update your personal or system-wide profile with the following:</para>
|
---|
[f570280] | 301 |
|
---|
[492000e] | 302 | <screen><literal>PATH=$PATH:/opt/fop</literal></screen>
|
---|
[f570280] | 303 |
|
---|
| 304 | </sect3>
|
---|
| 305 |
|
---|
| 306 | </sect2>
|
---|
| 307 |
|
---|
| 308 | <sect2 role="content">
|
---|
| 309 | <title>Contents</title>
|
---|
| 310 |
|
---|
| 311 | <segmentedlist>
|
---|
| 312 | <segtitle>Installed Programs</segtitle>
|
---|
| 313 | <segtitle>Installed Libraries</segtitle>
|
---|
| 314 | <segtitle>Installed Directory</segtitle>
|
---|
| 315 |
|
---|
| 316 | <seglistitem>
|
---|
[492000e] | 317 | <seg>fop</seg>
|
---|
| 318 | <seg>fop.jar and numerous support library classes located in
|
---|
| 319 | <filename class='directory'>/opt/fop/{build,lib}</filename>; JAI
|
---|
| 320 | components include libmlib_jai.so, jai_codec.jar, jai_core.jar, and
|
---|
[f570280] | 321 | mlibwrapper_jai.jar</seg>
|
---|
| 322 | <seg>/opt/fop-&fop-version;</seg>
|
---|
| 323 | </seglistitem>
|
---|
| 324 | </segmentedlist>
|
---|
| 325 |
|
---|
| 326 | <variablelist>
|
---|
| 327 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 328 | <?dbfo list-presentation="list"?>
|
---|
| 329 | <?dbhtml list-presentation="table"?>
|
---|
| 330 |
|
---|
[492000e] | 331 | <varlistentry id="fop-prog">
|
---|
| 332 | <term><command>fop</command></term>
|
---|
[f570280] | 333 | <listitem>
|
---|
| 334 | <para>is a wrapper script to the <command>java</command> command
|
---|
| 335 | which sets up the <application>FOP</application>
|
---|
| 336 | environment and passes the required parameters.</para>
|
---|
[492000e] | 337 | <indexterm zone="fop fop-prog">
|
---|
| 338 | <primary sortas="b-fop">fop</primary>
|
---|
[f570280] | 339 | </indexterm>
|
---|
| 340 | </listitem>
|
---|
| 341 | </varlistentry>
|
---|
| 342 |
|
---|
| 343 | <varlistentry id="fop.jar">
|
---|
| 344 | <term><filename class='libraryfile'>fop.jar</filename></term>
|
---|
| 345 | <listitem>
|
---|
| 346 | <para>contains all the <application>FOP</application>
|
---|
| 347 | <application>Java</application> classes.</para>
|
---|
| 348 | <indexterm zone="fop fop.jar">
|
---|
| 349 | <primary sortas="c-fop.jar">fop.jar</primary>
|
---|
| 350 | </indexterm>
|
---|
| 351 | </listitem>
|
---|
| 352 | </varlistentry>
|
---|
| 353 |
|
---|
| 354 | </variablelist>
|
---|
| 355 |
|
---|
| 356 | </sect2>
|
---|
| 357 |
|
---|
| 358 | </sect1>
|
---|