source: pst/ps/fop.xml@ faa948c

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since faa948c was 9a4c8a4e, checked in by Xi Ruoyao <xry111@…>, 12 months ago

pst: Remove non-exist User Notes link

Part of User Notes removal by
https://www.linuxfromscratch.org/~xry111/remove-nonexist-usernote.sh

  • Property mode set to 100644
File size: 15.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY fop-download-http "https://archive.apache.org/dist/xmlgraphics/fop/source/fop-&fop-version;-src.tar.gz">
8 <!ENTITY fop-download-ftp " ">
9 <!ENTITY fop-md5sum "610bfd7797755d744b2c4f61422478cf">
10 <!ENTITY fop-size "22 MB">
11 <!ENTITY fop-buildsize "517 MB (including files downloaded to the user directory)">
12 <!ENTITY fop-time "0.6 SBU">
13
14 <!ENTITY pdfbox-version "2.0.27">
15 <!ENTITY pdfbox-download "https://archive.apache.org/dist/pdfbox/&pdfbox-version;/pdfbox-&pdfbox-version;.jar">
16 <!ENTITY pdfbox-md5sum "ddd46402b1692eed9e5c73b4a94c45d8">
17 <!ENTITY pdfbox-size "2.7 MB">
18
19 <!ENTITY fontbox-download "https://archive.apache.org/dist/pdfbox/&pdfbox-version;/fontbox-&pdfbox-version;.jar">
20 <!ENTITY fontbox-md5sum "587744efe2a82d3584c2f3969fa4dca0">
21 <!ENTITY fontbox-size "1.5 MB">
22
23 <!ENTITY maven-major "3">
24 <!ENTITY maven-version "3.8.6">
25 <!ENTITY maven-download "https://archive.apache.org/dist/maven/maven-&maven-major;/&maven-version;/binaries/apache-maven-&maven-version;-bin.tar.gz">
26 <!ENTITY maven-md5sum "0e07de4a7b5c84ebed737a2002f52019">
27 <!ENTITY maven-size "8.3 MB (additionally, about 90 MB are downloaded to the building user's directory)">
28
29 <!ENTITY offo-download "&sourceforge-dl;/offo/2.2/offo-hyphenation.zip">
30 <!ENTITY offo-md5sum "bf9c09bf05108ef9661b8f08d91c2336">
31 <!ENTITY offo-size "862 KB">
32]>
33
34<sect1 id="fop" xreflabel="fop-&fop-version;">
35 <?dbhtml filename="fop.html"?>
36
37
38 <title>fop-&fop-version;</title>
39
40 <indexterm zone="fop">
41 <primary sortas="a-fop">fop</primary>
42 </indexterm>
43
44 <sect2 role="package">
45 <title>Introduction to fop</title>
46
47 <para>
48 The <application>FOP</application> (Formatting Objects Processor)
49 package contains a print formatter driven by XSL formatting objects
50 (XSL-FO). It is a <application>Java</application> application that reads
51 a formatting object tree and renders the resulting pages to a specified
52 output. Output formats currently supported include PDF, PCL, PostScript,
53 SVG, XML (area tree representation), print, AWT, MIF and ASCII text. The
54 primary output target is PDF.
55 </para>
56
57 &lfs113_checked;
58
59 <bridgehead renderas="sect3">Package Information</bridgehead>
60 <itemizedlist spacing="compact">
61 <listitem>
62 <para>
63 Download (HTTP): <ulink url="&fop-download-http;"/>
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Download (FTP): <ulink url="&fop-download-ftp;"/>
69 </para>
70 </listitem>
71 <listitem>
72 <para>
73 Download MD5 sum: &fop-md5sum;
74 </para>
75 </listitem>
76 <listitem>
77 <para>
78 Download size: &fop-size;
79 </para>
80 </listitem>
81 <listitem>
82 <para>
83 Estimated disk space required: &fop-buildsize;
84 </para>
85 </listitem>
86 <listitem>
87 <para>
88 Estimated build time: &fop-time;
89 </para>
90 </listitem>
91 </itemizedlist>
92
93 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
94 <itemizedlist spacing="compact">
95 <title>Required Additional Downloads:</title>
96 <listitem>
97 <para>
98 PDFBox:
99 <simplelist>
100 <member><ulink url="&pdfbox-download;"/></member>
101 <member>&pdfbox-md5sum;</member>
102 <member>&pdfbox-size;</member>
103 </simplelist>
104 </para>
105 </listitem>
106 <listitem>
107 <para>
108 PDFBox Fonts:
109 <simplelist>
110 <member><ulink url="&fontbox-download;"/></member>
111 <member>&fontbox-md5sum;</member>
112 <member>&fontbox-size;</member>
113 </simplelist>
114 </para>
115 </listitem>
116 <listitem>
117 <para>
118 Maven build system:
119 <simplelist>
120 <member><ulink url="&maven-download;"/></member>
121 <member>&maven-md5sum;</member>
122 <member>&maven-size;</member>
123 </simplelist>
124 </para>
125 </listitem>
126 </itemizedlist>
127<!-- Using the archive above allows finding all versions
128 <note><para>
129 The pdfbox and fontbox packages may not be available at the above
130 location. If not, they can be found at the BLFS files mirror sites.
131 </para></note>
132-->
133 <itemizedlist spacing="compact">
134 <title>Recommended packages</title>
135 <listitem>
136 <para>
137 Objects for Formatting Objects (OFFO) hyphenation patterns:
138 <simplelist>
139 <member><ulink url="&offo-download;"/></member>
140 <member>&offo-md5sum;</member>
141 <member>&offo-size;</member>
142 </simplelist>
143 </para>
144 </listitem>
145 </itemizedlist>
146
147 <bridgehead renderas="sect3">fop Dependencies</bridgehead>
148
149 <bridgehead renderas="sect4">Required</bridgehead>
150 <para role="required">
151 <xref linkend="apache-ant"/>
152 </para>
153
154 <bridgehead renderas="sect4">Optional</bridgehead>
155 <para role="optional">
156<!-- Included into ant <xref linkend="junit"/> (to run tests),-->
157 <xref linkend="x-window-system"/> (to run tests),
158<!-- <xref linkend="maven"/> (an alternate build system), not functional
159 with fop-2.3 -->
160 <ulink url="https://jai-tools.blogspot.com/">JAI Image I/O Tools</ulink>, and
161 <ulink url="https://jeuclid.sourceforge.net/">JEuclid</ulink>
162<!-- [pierre 2017-04-29] Note to devs: there are a lot of bundled dependencies.
163 Some were listed here, but not all. I am not sure it is possible to
164 use system ones. So, I have removed them, and kept only those which
165 are not bundled. -->
166 </para>
167
168
169 </sect2>
170
171 <sect2 role="installation">
172 <title>Installation of fop</title>
173
174 <para>
175 Ensure <envar>$JAVA_HOME</envar> is set correctly before beginning
176 the build. To build the <application>JIMI SDK</application> and/or
177 <application>XMLUnit</application> extension classes, ensure the
178 corresponding <filename class='extension'>.jar</filename> files can be
179 found via the <envar>CLASSPATH</envar> environment variable.
180 </para>
181
182 <sect3>
183 <title>Installing OFFO Hyphenation Patterns</title>
184
185 <para>
186 Copy the XML hyphenation patterns into the fop source tree by running
187 the following commands:
188 </para>
189
190<screen><userinput>unzip ../offo-hyphenation.zip &amp;&amp;
191cp offo-hyphenation/hyph/* fop/hyph &amp;&amp;
192rm -rf offo-hyphenation</userinput></screen>
193
194 </sect3>
195
196 <sect3>
197 <title>Installing a temporary Maven binary</title>
198
199 <para>
200 Starting with fop-2.5, the Maven build system is required. We use
201 the binary provided by apache, that we install in a temporary location:
202 </para>
203
204<screen><userinput>tar -xf ../apache-maven-&maven-version;-bin.tar.gz -C /tmp</userinput></screen>
205
206 </sect3>
207
208 <sect3>
209 <title>Installing fop Components</title>
210
211 <para>
212 The <command>javadoc</command> command that ships with OpenJDK 10 and
213 later has
214 become much stricter than previous versions regarding conformance of
215 the Javadoc comments in source code to HTML. The FOP documentation does
216 not meet those standards, so the conformance checks have to be
217 disabled. This can be done with the following command:
218 </para>
219
220<screen><userinput>sed -i '\@&lt;/javad@i\
221&lt;arg value="-Xdoclint:none"/&gt;\
222&lt;arg value="--allow-script-in-comments"/&gt;\
223&lt;arg value="--ignore-source-errors"/&gt;' \
224 fop/build.xml</userinput></screen>
225<!-- Seems to have been fixed in 2.6
226 <para>
227 The stack size set in <filename>build.xml</filename> for building the
228 hyphenation patterns is not large enough. Change it by running:
229 </para>
230
231<screen><userinput>sed -e '/hyph\.stack/s/512k/1M/' \
232 -i fop/build.xml</userinput></screen>
233fixed with maven-3.8.4
234 <para>
235 Fix building with JDK-16 due to an outdated Apache Maven plugin:
236 </para>
237
238<screen><userinput remap="pre">sed -i 's/&lt;war.plugin.version&gt;2.2/&lt;war.plugin.version&gt;3.3.1/' pom.xml</userinput></screen>
239-->
240 <para>
241 The <filename>build.xml</filename> file calls for an old version of
242 <application>PDFBox</application> components that are no longer
243 available. Copy the updated PDFBox components into the source tree:
244 </para>
245
246<screen><userinput>cp ../{pdf,font}box-&pdfbox-version;.jar fop/lib</userinput></screen>
247
248 <para>
249 Compile <application>fop</application> by running the following
250 commands:
251 </para>
252
253<screen><userinput>cd fop &amp;&amp;
254
255LC_ALL=en_US.UTF-8 \
256PATH=$PATH:/tmp/apache-maven-&maven-version;/bin \
257ant all javadocs &amp;&amp;
258
259mv build/javadocs .</userinput></screen>
260
261 <para>
262 This package comes with a test suite, but the java infrastructure
263 installed in this book does not allow running it.
264 </para>
265
266 <para>
267 Now, install <application>Fop</application> as the
268 <systemitem class="username">root</systemitem> user:
269 </para>
270
271<screen role="root"><userinput>install -v -d -m755 -o root -g root /opt/fop-&fop-version; &amp;&amp;
272cp -vR build conf examples fop* javadocs lib /opt/fop-&fop-version; &amp;&amp;
273chmod a+x /opt/fop-&fop-version;/fop &amp;&amp;
274ln -v -sfn fop-&fop-version; /opt/fop</userinput></screen>
275
276 <para>
277 The last thing to do is to clean what we have done:
278 </para>
279
280<screen><userinput>rm -rf /tmp/apache-maven-&maven-version;</userinput></screen>
281
282 </sect3>
283
284 </sect2>
285
286 <sect2 role="commands">
287 <title>Command Explanations</title>
288
289 <para>
290 <command>sed -i ... build.xml</command>: This adds three switches to the
291 <command>javadoc</command> command, preventing some errors from occurring
292 when building the documentation.
293 </para>
294
295 <para>
296 <command>export LC_ALL=en_US.UTF-8</command>: the compiler fails if using
297 an ASCII locale.
298 </para>
299
300 <para>
301 <command>ant <option>target</option></command>: This reads the file
302 <filename>build.xml</filename> and builds the target: <option>compile
303 </option> compiles the java sources, <option>jar-main</option> generates
304 jar archives, <option>jar-hyphenation</option> generates the hyphenation
305 patterns for FOP, <option>junit</option> runs the
306 <application>junit</application> tests, and <option>javadocs</option>
307 builds the documentation. The <option>all</option> target runs all of the
308 above.
309 </para>
310
311 <para>
312 <command>ln -v -sf fop-&fop-version; /opt/fop</command>: This is
313 optional and creates a convenience symlink so that
314 <envar>$FOP_HOME</envar> doesn't have to be changed each time there's a
315 package version change.
316 </para>
317
318 </sect2>
319
320 <sect2 role="configuration">
321 <title>Configuring fop</title>
322
323 <sect3 id="fop-config">
324 <title>Config Files</title>
325
326 <para>
327 <filename>~/.foprc</filename>
328 </para>
329
330 <indexterm zone="fop fop-config">
331 <primary sortas="e-AA.foprc">~/.foprc</primary>
332 </indexterm>
333
334 </sect3>
335
336 <sect3>
337 <title>Configuration Information</title>
338
339 <para>
340 Using <application>fop</application> to process some large FO's
341 (including the FO derived from the BLFS XML sources), can lead to
342 memory errors. Unless you add a parameter to the
343 <command>java</command> command used in the <command>fop</command>
344 script you may receive messages similar to the one shown below:
345 </para>
346
347 <para>
348 <computeroutput>
349 Exception in thread "main" java.lang.OutOfMemoryError: Java heap
350 space
351 </computeroutput>
352 </para>
353
354 <para>
355 To avoid errors like this, you need to pass an extra parameter to
356 the <command>java</command> command used in the <command>fop</command>
357 script. This can be accomplished by creating a
358 <filename>~/.foprc</filename> (which is sourced by the
359 <command>fop</command> script) and adding the parameter to the
360 <envar>FOP_OPTS</envar> environment variable.
361 </para>
362
363 <para>
364 The <command>fop</command> script looks for a
365 <envar>FOP_HOME</envar> environment variable to locate the
366 <application>fop</application> class libraries. You can create this
367 variable using the <filename>~/.foprc</filename> file as well. Create
368 a <filename>~/.foprc</filename> file using the following commands:
369 </para>
370
371<screen><userinput>cat &gt; ~/.foprc &lt;&lt; "EOF"
372<literal>FOP_OPTS="-Xmx<replaceable>&lt;RAM_Installed&gt;</replaceable>m"
373FOP_HOME="/opt/fop"</literal>
374EOF</userinput></screen>
375
376 <para>
377 Replace <replaceable>&lt;RAM_Installed&gt;</replaceable> with a
378 number representing the amount of RAM installed in your computer (in
379 megabytes). An example would be
380 <userinput>FOP_OPTS="-Xmx768m"</userinput>.
381 <!-- the URL is broken
382 For more information about
383 memory issues running <application>fop</application>, see
384 <ulink url="http://xml.apache.org/fop/running.html#memory"/>.
385 -->
386 </para>
387
388 <para>
389 To include the <command>fop</command> script in your path,
390 update the system-wide profile with the following command as the
391 <systemitem class="username">root</systemitem> user:
392 </para>
393
394<screen role="root"><userinput>cat &gt; /etc/profile.d/fop.sh &lt;&lt; "EOF"
395<literal># Begin /etc/profile.d/fop.sh
396
397pathappend /opt/fop
398
399# End /etc/profile.d/fop.sh</literal>
400EOF</userinput></screen>
401
402 <note>
403 <para>
404 Running <command>fop</command> can be somewhat verbose.
405 The default logging level can be changed from INFO to any of
406 FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, ALL, or OFF.
407 To do this, edit
408 <filename>$JAVA_HOME/jre/lib/logging.properties</filename> and change
409 the entries for <option>.level</option> and
410 <option>java.util.logging.ConsoleHandler.level</option> to
411 the desired value.
412 </para>
413 </note>
414
415 </sect3>
416
417 </sect2>
418
419 <sect2 role="content">
420 <title>Contents</title>
421
422 <segmentedlist>
423 <segtitle>Installed Programs</segtitle>
424 <segtitle>Installed Libraries</segtitle>
425 <segtitle>Installed Directory</segtitle>
426
427 <seglistitem>
428 <seg>fop</seg>
429 <seg>fop.jar and numerous support library classes located in
430 <filename class="directory">/opt/fop/{build,lib}</filename>; JAI
431 components include libmlib_jai.so, jai_codec.jar, jai_core.jar, and
432 mlibwrapper_jai.jar</seg>
433 <seg>/opt/fop-&fop-version;</seg>
434 </seglistitem>
435 </segmentedlist>
436
437 <variablelist>
438 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
439 <?dbfo list-presentation="list"?>
440 <?dbhtml list-presentation="table"?>
441
442 <varlistentry id="fop-prog">
443 <term><command>fop</command></term>
444 <listitem>
445 <para>
446 is a wrapper script to the <command>java</command> command
447 which sets up the <application>fop</application>
448 environment and passes the required parameters
449 </para>
450 <indexterm zone="fop fop-prog">
451 <primary sortas="b-fop">fop</primary>
452 </indexterm>
453 </listitem>
454 </varlistentry>
455
456 <varlistentry id="fop.jar">
457 <term><filename class="libraryfile">fop.jar</filename></term>
458 <listitem>
459 <para>
460 contains all the <application>fop</application>
461 <application>Java</application> classes
462 </para>
463 <indexterm zone="fop fop.jar">
464 <primary sortas="c-fop.jar">fop.jar</primary>
465 </indexterm>
466 </listitem>
467 </varlistentry>
468
469 </variablelist>
470
471 </sect2>
472
473</sect1>
Note: See TracBrowser for help on using the repository browser.