source: pst/ps/fop.xml@ 17aa21c

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 17aa21c was 17aa21c, checked in by Xi Ruoyao <xry111@…>, 15 months ago

Change all http://*.sourceforge.net/ URLs to https

Now all sourceforge.net subdomains have a valid SSL certificate. The
changes are automatically done via a sed. I've reviewed the changes and
reverted the changes in archive/*, pst/xml/docbook-xsl.xml, and
stylesheets/lfs-xsl/lfs-l10n.xml. Other changes should (hopefully) be
fine.

  • Property mode set to 100644
File size: 16.0 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 "http://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 "http://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 "http://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 &lfs112_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="http://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 <para condition="html" role="usernotes">User Notes:
169 <ulink url="&blfs-wiki;/fop"/></para>
170
171 </sect2>
172
173 <sect2 role="installation">
174 <title>Installation of fop</title>
175
176 <para>
177 Ensure <envar>$JAVA_HOME</envar> is set correctly before beginning
178 the build. To build the <application>JIMI SDK</application> and/or
179 <application>XMLUnit</application> extension classes, ensure the
180 corresponding <filename class='extension'>.jar</filename> files can be
181 found via the <envar>CLASSPATH</envar> environment variable.
182 </para>
183
184 <sect3>
185 <title>Installing OFFO Hyphenation Patterns</title>
186
187 <para>
188 Copy the XML hyphenation patterns into the fop source tree by running
189 the following commands:
190 </para>
191
192<screen><userinput>unzip ../offo-hyphenation.zip &amp;&amp;
193cp offo-hyphenation/hyph/* fop/hyph &amp;&amp;
194rm -rf offo-hyphenation</userinput></screen>
195
196 </sect3>
197
198 <sect3>
199 <title>Installing a temporary Maven binary</title>
200
201 <para>
202 Starting with fop-2.5, the Maven build system is required. We use
203 the binary provided by apache, that we install in a temporary location:
204 </para>
205
206<screen><userinput>tar -xf ../apache-maven-&maven-version;-bin.tar.gz -C /tmp</userinput></screen>
207
208 </sect3>
209
210 <sect3>
211 <title>Installing fop Components</title>
212
213 <para>
214 The <command>javadoc</command> command that ships with OpenJDK 10 and
215 later has
216 become much stricter than previous versions regarding conformance of
217 the Javadoc comments in source code to HTML. The FOP documentation does
218 not meet those standards, so the conformance checks have to be
219 disabled. This can be done with the following command:
220 </para>
221
222<screen><userinput>sed -i '\@&lt;/javad@i\
223&lt;arg value="-Xdoclint:none"/&gt;\
224&lt;arg value="--allow-script-in-comments"/&gt;\
225&lt;arg value="--ignore-source-errors"/&gt;' \
226 fop/build.xml</userinput></screen>
227<!-- Seems to have been fixed in 2.6
228 <para>
229 The stack size set in <filename>build.xml</filename> for building the
230 hyphenation patterns is not large enough. Change it by running:
231 </para>
232
233<screen><userinput>sed -e '/hyph\.stack/s/512k/1M/' \
234 -i fop/build.xml</userinput></screen>
235fixed with maven-3.8.4
236 <para>
237 Fix building with JDK-16 due to an outdated Apache Maven plugin:
238 </para>
239
240<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>
241-->
242 <para>
243 The <filename>build.xml</filename> file calls for an old version of
244 <application>PDFBox</application> components that are no longer
245 available. Copy the updated PDFBox components into the source tree:
246 </para>
247
248<screen><userinput>cp ../{pdf,font}box-&pdfbox-version;.jar fop/lib</userinput></screen>
249
250 <para>
251 Compile <application>fop</application> by running the following
252 commands:
253 </para>
254
255<screen><userinput>cd fop &amp;&amp;
256
257LC_ALL=en_US.UTF-8 \
258PATH=$PATH:/tmp/apache-maven-&maven-version;/bin \
259ant all javadocs &amp;&amp;
260
261mv build/javadocs .</userinput></screen>
262
263 <para>
264 This package comes with a test suite, but the java infrastructure
265 installed in this book does not allow running it.
266 </para>
267
268 <para>
269 Now, install <application>Fop</application> as the
270 <systemitem class="username">root</systemitem> user:
271 </para>
272
273<screen role="root"><userinput>install -v -d -m755 -o root -g root /opt/fop-&fop-version; &amp;&amp;
274cp -vR build conf examples fop* javadocs lib /opt/fop-&fop-version; &amp;&amp;
275chmod a+x /opt/fop-&fop-version;/fop &amp;&amp;
276ln -v -sfn fop-&fop-version; /opt/fop</userinput></screen>
277
278 <para>
279 The last thing to do is to clean what we have done:
280 </para>
281
282<screen><userinput>rm -rf /tmp/apache-maven-&maven-version;</userinput></screen>
283
284 </sect3>
285
286 </sect2>
287
288 <sect2 role="commands">
289 <title>Command Explanations</title>
290
291 <para>
292 <command>sed -i ... build.xml</command>: This adds three switches to the
293 <command>javadoc</command> command, preventing some errors from occurring
294 when building the documentation.
295 </para>
296
297 <para>
298 <command>export LC_ALL=en_US.UTF-8</command>: the compiler fails if using
299 an ASCII locale.
300 </para>
301
302 <para>
303 <command>ant <option>target</option></command>: This reads the file
304 <filename>build.xml</filename> and builds the target: <option>compile
305 </option> compiles the java sources, <option>jar-main</option> generates
306 jar archives, <option>jar-hyphenation</option> generates the hyphenation
307 patterns for FOP, <option>junit</option> runs the
308 <application>junit</application> tests, and <option>javadocs</option>
309 builds the documentation. The <option>all</option> target runs all of the
310 above.
311 </para>
312
313 <para>
314 <command>ln -v -sf fop-&fop-version; /opt/fop</command>: This is
315 optional and creates a convenience symlink so that
316 <envar>$FOP_HOME</envar> doesn't have to be changed each time there's a
317 package version change.
318 </para>
319
320 </sect2>
321
322 <sect2 role="configuration">
323 <title>Configuring fop</title>
324
325 <sect3 id="fop-config">
326 <title>Config Files</title>
327
328 <para>
329 <filename>~/.foprc</filename>
330 </para>
331
332 <indexterm zone="fop fop-config">
333 <primary sortas="e-AA.foprc">~/.foprc</primary>
334 </indexterm>
335
336 </sect3>
337
338 <sect3>
339 <title>Configuration Information</title>
340
341 <para>
342 Using <application>fop</application> to process some large FO's
343 (including the FO derived from the BLFS XML sources), can lead to
344 memory errors. Unless you add a parameter to the
345 <command>java</command> command used in the <command>fop</command>
346 script you may receive messages similar to the one shown below:
347 </para>
348
349 <para>
350 <computeroutput>
351 Exception in thread "main" java.lang.OutOfMemoryError: Java heap
352 space
353 </computeroutput>
354 </para>
355
356 <para>
357 To avoid errors like this, you need to pass an extra parameter to
358 the <command>java</command> command used in the <command>fop</command>
359 script. This can be accomplished by creating a
360 <filename>~/.foprc</filename> (which is sourced by the
361 <command>fop</command> script) and adding the parameter to the
362 <envar>FOP_OPTS</envar> environment variable.
363 </para>
364
365 <para>
366 The <command>fop</command> script looks for a
367 <envar>FOP_HOME</envar> environment variable to locate the
368 <application>fop</application> class libraries. You can create this
369 variable using the <filename>~/.foprc</filename> file as well. Create
370 a <filename>~/.foprc</filename> file using the following commands:
371 </para>
372
373<screen><userinput>cat &gt; ~/.foprc &lt;&lt; "EOF"
374<literal>FOP_OPTS="-Xmx<replaceable>&lt;RAM_Installed&gt;</replaceable>m"
375FOP_HOME="/opt/fop"</literal>
376EOF</userinput></screen>
377
378 <para>
379 Replace <replaceable>&lt;RAM_Installed&gt;</replaceable> with a
380 number representing the amount of RAM installed in your computer (in
381 megabytes). An example would be
382 <userinput>FOP_OPTS="-Xmx768m"</userinput>.
383 <!-- the URL is broken
384 For more information about
385 memory issues running <application>fop</application>, see
386 <ulink url="http://xml.apache.org/fop/running.html#memory"/>.
387 -->
388 </para>
389
390 <para>
391 To include the <command>fop</command> script in your path,
392 update the system-wide profile with the following command as the
393 <systemitem class="username">root</systemitem> user:
394 </para>
395
396<screen role="root"><userinput>cat &gt; /etc/profile.d/fop.sh &lt;&lt; "EOF"
397<literal># Begin /etc/profile.d/fop.sh
398
399pathappend /opt/fop
400
401# End /etc/profile.d/fop.sh</literal>
402EOF</userinput></screen>
403
404 <note>
405 <para>
406 Running <command>fop</command> can be somewhat verbose.
407 The default logging level can be changed from INFO to any of
408 FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, ALL, or OFF.
409 To do this, edit
410 <filename>$JAVA_HOME/jre/lib/logging.properties</filename> and change
411 the entries for <option>.level</option> and
412 <option>java.util.logging.ConsoleHandler.level</option> to
413 the desired value.
414 </para>
415 </note>
416
417 </sect3>
418
419 </sect2>
420
421 <sect2 role="content">
422 <title>Contents</title>
423
424 <segmentedlist>
425 <segtitle>Installed Programs</segtitle>
426 <segtitle>Installed Libraries</segtitle>
427 <segtitle>Installed Directory</segtitle>
428
429 <seglistitem>
430 <seg>fop</seg>
431 <seg>fop.jar and numerous support library classes located in
432 <filename class="directory">/opt/fop/{build,lib}</filename>; JAI
433 components include libmlib_jai.so, jai_codec.jar, jai_core.jar, and
434 mlibwrapper_jai.jar</seg>
435 <seg>/opt/fop-&fop-version;</seg>
436 </seglistitem>
437 </segmentedlist>
438
439 <variablelist>
440 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
441 <?dbfo list-presentation="list"?>
442 <?dbhtml list-presentation="table"?>
443
444 <varlistentry id="fop-prog">
445 <term><command>fop</command></term>
446 <listitem>
447 <para>
448 is a wrapper script to the <command>java</command> command
449 which sets up the <application>fop</application>
450 environment and passes the required parameters
451 </para>
452 <indexterm zone="fop fop-prog">
453 <primary sortas="b-fop">fop</primary>
454 </indexterm>
455 </listitem>
456 </varlistentry>
457
458 <varlistentry id="fop.jar">
459 <term><filename class="libraryfile">fop.jar</filename></term>
460 <listitem>
461 <para>
462 contains all the <application>fop</application>
463 <application>Java</application> classes
464 </para>
465 <indexterm zone="fop fop.jar">
466 <primary sortas="c-fop.jar">fop.jar</primary>
467 </indexterm>
468 </listitem>
469 </varlistentry>
470
471 </variablelist>
472
473 </sect2>
474
475</sect1>
Note: See TracBrowser for help on using the repository browser.