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