mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-27 18:02:12 +08:00
a288a10749
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@20431 af4574ff-66df-0310-9fd7-8a98e5e911e0
411 lines
14 KiB
XML
411 lines
14 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!ENTITY fop-download-http "https://archive.apache.org/dist/xmlgraphics/fop/source/fop-&fop-version;-src.tar.gz">
|
|
<!ENTITY fop-download-ftp " ">
|
|
<!ENTITY fop-md5sum "fc95040a8db4a7f22c6f26e18fd6d033">
|
|
<!ENTITY fop-size "26 MB">
|
|
<!ENTITY fop-buildsize "497 MB ">
|
|
<!ENTITY fop-time "1.1 SBU">
|
|
|
|
<!ENTITY pdfbox-version "2.0.11">
|
|
<!ENTITY pdfbox-download "http://mirror.reverse.net/pub/apache/pdfbox/&pdfbox-version;/pdfbox-&pdfbox-version;.jar">
|
|
<!ENTITY pdfbox-md5sum "93fbcf37217d0caab35f79476f2ffd1d">
|
|
<!ENTITY pdfbox-size "2.4 MB">
|
|
|
|
<!ENTITY fontbox-download "http://mirror.reverse.net/pub/apache/pdfbox/&pdfbox-version;/fontbox-&pdfbox-version;.jar">
|
|
<!ENTITY fontbox-md5sum "4e139453c2bda1e4ce1ff1e90acae04b">
|
|
<!ENTITY fontbox-size "1.5 MB">
|
|
|
|
<!ENTITY offo-download "&sourceforge-dl;/offo/2.2/offo-hyphenation.zip">
|
|
<!ENTITY offo-md5sum "bf9c09bf05108ef9661b8f08d91c2336">
|
|
<!ENTITY offo-size "862 KB">
|
|
]>
|
|
|
|
<sect1 id="fop" xreflabel="fop-&fop-version;">
|
|
<?dbhtml filename="fop.html"?>
|
|
|
|
<sect1info>
|
|
<othername>$LastChangedBy$</othername>
|
|
<date>$Date$</date>
|
|
</sect1info>
|
|
|
|
<title>fop-&fop-version;</title>
|
|
|
|
<indexterm zone="fop">
|
|
<primary sortas="a-fop">fop</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to fop</title>
|
|
|
|
<para>
|
|
The <application>FOP</application> (Formatting Objects Processor)
|
|
package contains a print formatter driven by XSL formatting objects
|
|
(XSL-FO). It is a <application>Java</application> application that reads
|
|
a formatting object tree and renders the resulting pages to a specified
|
|
output. Output formats currently supported include PDF, PCL, PostScript,
|
|
SVG, XML (area tree representation), print, AWT, MIF and ASCII text. The
|
|
primary output target is PDF.
|
|
</para>
|
|
|
|
&lfs83_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>Download (HTTP): <ulink url="&fop-download-http;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download (FTP): <ulink url="&fop-download-ftp;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download MD5 sum: &fop-md5sum;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download size: &fop-size;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated disk space required: &fop-buildsize;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated build time: &fop-time;</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<title>Required Additional Downloads:</title>
|
|
<listitem>
|
|
<para>PDFBox:
|
|
<simplelist>
|
|
<member><ulink url="&pdfbox-download;"/></member>
|
|
<member>&pdfbox-md5sum;</member>
|
|
<member>&pdfbox-size;</member>
|
|
</simplelist>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>PDFBox Fonts:
|
|
<simplelist>
|
|
<member><ulink url="&fontbox-download;"/></member>
|
|
<member>&fontbox-md5sum;</member>
|
|
<member>&fontbox-size;</member>
|
|
</simplelist>
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<itemizedlist spacing="compact">
|
|
<title>Recommended packages</title>
|
|
<listitem>
|
|
<para>Objects for Formatting Objects (OFFO) hyphenation patterns:
|
|
<simplelist>
|
|
<member><ulink url="&offo-download;"/></member>
|
|
<member>&offo-md5sum;</member>
|
|
<member>&offo-size;</member>
|
|
</simplelist>
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<bridgehead renderas="sect3">fop Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
|
<para role="required">
|
|
<xref linkend="apache-ant"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="junit"/> (to run tests),
|
|
<xref linkend="x-window-system"/> (to run tests),
|
|
<xref linkend="maven"/> (an alternate build system),
|
|
<ulink url="https://java.net/projects/jai-imageio">JAI Image I/O Tools</ulink>, and
|
|
<ulink url="http://jeuclid.sourceforge.net/">JEuclid</ulink>
|
|
<!-- [pierre 2017-04-29] Note to devs: there are a lot of bundled dependencies.
|
|
Some were listed here, but not all. I am not sure it is possible to
|
|
use system ones. So, I have removed them, an kept only those which
|
|
are not bundled. -->
|
|
</para>
|
|
|
|
<para condition="html" role="usernotes">User Notes:
|
|
<ulink url="&blfs-wiki;/fop"/></para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of fop</title>
|
|
|
|
<para>
|
|
Ensure <envar>$JAVA_HOME</envar> is set correctly before beginning
|
|
the build. To build the <application>JIMI SDK</application> and/or
|
|
<application>XMLUnit</application> extension classes, ensure the
|
|
corresponding <filename class='extension'>.jar</filename> files can be
|
|
found via the <envar>CLASSPATH</envar> environment variable.
|
|
</para>
|
|
|
|
<sect3>
|
|
<title>Installing OFFO Hyphenation Patterns</title>
|
|
|
|
<para>
|
|
Copy the XML hyphenation patterns into the fop source tree by running
|
|
the following commands:
|
|
</para>
|
|
|
|
<screen><userinput>unzip ../offo-hyphenation.zip &&
|
|
cp offo-hyphenation/hyph/* fop/hyph &&
|
|
rm -rf offo-hyphenation</userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
<sect3>
|
|
<title>Installing fop Components</title>
|
|
|
|
<para>
|
|
The <command>javadoc</command> command that ships with OpenJDK 10 has
|
|
become much more strict than previous versions regarding conformance of
|
|
the Javadoc comments in source code to HTML. The FOP documentation does
|
|
not meet those standards, so the conformance checks have to be
|
|
disabled. This can be done with the following command:
|
|
</para>
|
|
|
|
<screen><userinput>sed -i '\@</javad@i\
|
|
<arg value="-Xdoclint:none"/>\
|
|
<arg value="--allow-script-in-comments"/>\
|
|
<arg value="--ignore-source-errors"/>' \
|
|
fop/build.xml</userinput></screen>
|
|
|
|
<para>
|
|
The stack size set in <filename>build.xml</filename> for building the
|
|
hyphenation patterns is not large enough. Change it by running:
|
|
</para>
|
|
|
|
<screen><userinput>sed -e '/hyph\.stack/s/512k/1M/' \
|
|
-i fop/build.xml</userinput></screen>
|
|
|
|
<para>
|
|
The <filename>build.xml</filename> file calls for an old version of
|
|
<application>PDFBox</application> components that are no longer
|
|
available. Copy the updated PDFBox components into the source tree:
|
|
</para>
|
|
|
|
<screen><userinput>cp ../{pdf,font}box-&pdfbox-version;.jar fop/lib</userinput></screen>
|
|
|
|
<para>
|
|
Compile <application>fop</application> by running the following
|
|
commands:
|
|
</para>
|
|
|
|
<screen><userinput>cd fop &&
|
|
export LC_ALL=en_US.UTF-8 &&
|
|
ant all javadocs &&
|
|
mv build/javadocs .</userinput></screen>
|
|
|
|
<para>
|
|
The <application>junit</application> test suite was run as part of the
|
|
above commands.
|
|
</para>
|
|
|
|
<para>
|
|
Now, install <application>Fop</application> as the
|
|
<systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>install -v -d -m755 -o root -g root /opt/fop-&fop-version; &&
|
|
cp -vR build conf examples fop* javadocs lib /opt/fop-&fop-version; &&
|
|
chmod a+x /opt/fop-&fop-version;/fop &&
|
|
ln -v -sfn fop-&fop-version; /opt/fop</userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="commands">
|
|
<title>Command Explanations</title>
|
|
|
|
<para>
|
|
<command>sed -i ... build.xml</command>: This adds two switches to the
|
|
<command>javadoc</command> command, preventing some errors to occur when
|
|
building the documentation.
|
|
</para>
|
|
|
|
<para>
|
|
<command>export LC_ALL=en_US.UTF-8</command>: the compiler fails if using
|
|
an ASCII locale.
|
|
</para>
|
|
|
|
<para>
|
|
<command>ant <option>target</option></command>: This reads the file
|
|
<filename>build.xml</filename> and builds the target: <option>compile
|
|
</option> compiles the java sources, <option>jar-main</option> generates
|
|
jar archives, <option>jar-hyphenation</option> generates the hyphenation
|
|
patterns for FOP, <option>junit</option> runs the
|
|
<application>junit</application> tests, and <option>javadocs</option>
|
|
builds the documentation. The <option>all</option> target runs all of the
|
|
above.
|
|
</para>
|
|
|
|
<para>
|
|
<command>ln -v -sf fop-&fop-version; /opt/fop</command>: This is
|
|
optional and creates a convenience symlink so that
|
|
<envar>$FOP_HOME</envar> doesn't have to be changed each time there's a
|
|
package version change.
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="configuration">
|
|
<title>Configuring fop</title>
|
|
|
|
<sect3 id="fop-config">
|
|
<title>Config Files</title>
|
|
|
|
<para>
|
|
<filename>~/.foprc</filename>
|
|
</para>
|
|
|
|
<indexterm zone="fop fop-config">
|
|
<primary sortas="e-AA.foprc">~/.foprc</primary>
|
|
</indexterm>
|
|
|
|
</sect3>
|
|
|
|
<sect3>
|
|
<title>Configuration Information</title>
|
|
|
|
<para>
|
|
Using <application>fop</application> to process some large FO's
|
|
(including the FO derived from the BLFS XML sources), can lead to
|
|
memory errors. Unless you add a parameter to the
|
|
<command>java</command> command used in the <command>fop</command>
|
|
script you may receive messages similar to the one shown below:
|
|
</para>
|
|
|
|
<para>
|
|
<computeroutput>
|
|
Exception in thread "main" java.lang.OutOfMemoryError: Java heap
|
|
space
|
|
</computeroutput>
|
|
</para>
|
|
|
|
<para>
|
|
To avoid errors like this, you need to pass an extra parameter to
|
|
the <command>java</command> command used in the <command>fop</command>
|
|
script. This can be accomplished by creating a
|
|
<filename>~/.foprc</filename> (which is sourced by the
|
|
<command>fop</command> script) and adding the parameter to the
|
|
<envar>FOP_OPTS</envar> environment variable.
|
|
</para>
|
|
|
|
<para>
|
|
The <command>fop</command> script looks for a
|
|
<envar>FOP_HOME</envar> environment variable to locate the
|
|
<application>fop</application> class libraries. You can create this
|
|
variable using the <filename>~/.foprc</filename> file as well. Create
|
|
a <filename>~/.foprc</filename> file using the following commands:
|
|
</para>
|
|
|
|
<screen><userinput>cat > ~/.foprc << "EOF"
|
|
<literal>FOP_OPTS="-Xmx<replaceable><RAM_Installed></replaceable>m"
|
|
FOP_HOME="/opt/fop"</literal>
|
|
EOF</userinput></screen>
|
|
|
|
<para>
|
|
Replace <replaceable><RAM_Installed></replaceable> with a
|
|
number representing the amount of RAM installed in your computer (in
|
|
megabytes). An example would be
|
|
<userinput>FOP_OPTS="-Xmx768m"</userinput>.
|
|
<!-- the URL is broken
|
|
For more information about
|
|
memory issues running <application>fop</application>, see
|
|
<ulink url="http://xml.apache.org/fop/running.html#memory"/>.
|
|
-->
|
|
</para>
|
|
|
|
<para>
|
|
To include the <command>fop</command> script in your path,
|
|
update the system-wide profile with the following command as the
|
|
<systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen><literal>cat > /etc/profile.d/fop.sh << "EOF"
|
|
# Begin /etc/profile.d/fop.sh
|
|
|
|
pathappend /opt/fop
|
|
|
|
# End /etc/profile.d/fop.sh
|
|
EOF</literal></screen>
|
|
|
|
<note>
|
|
<para>
|
|
Running <command>fop</command> can be somewhat verbose.
|
|
The default logging level can be changed from INFO to any of
|
|
FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, ALL, or OFF.
|
|
To do this, edit
|
|
<filename>$JAVA_HOME/jre/lib/logging.properties</filename> and change
|
|
the entries for <option>.level</option> and
|
|
<option>java.util.logging.ConsoleHandler.level</option> to
|
|
the desired value.
|
|
</para>
|
|
</note>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directory</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>fop</seg>
|
|
<seg>fop.jar and numerous support library classes located in
|
|
<filename class='directory'>/opt/fop/{build,lib}</filename>; JAI
|
|
components include libmlib_jai.so, jai_codec.jar, jai_core.jar, and
|
|
mlibwrapper_jai.jar</seg>
|
|
<seg>/opt/fop-&fop-version;</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="fop-prog">
|
|
<term><command>fop</command></term>
|
|
<listitem>
|
|
<para>is a wrapper script to the <command>java</command> command
|
|
which sets up the <application>fop</application>
|
|
environment and passes the required parameters.</para>
|
|
<indexterm zone="fop fop-prog">
|
|
<primary sortas="b-fop">fop</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="fop.jar">
|
|
<term><filename class='libraryfile'>fop.jar</filename></term>
|
|
<listitem>
|
|
<para>contains all the <application>fop</application>
|
|
<application>Java</application> classes.</para>
|
|
<indexterm zone="fop fop.jar">
|
|
<primary sortas="c-fop.jar">fop.jar</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|