<page id="optimise" label="Optimisations" source="optimise.xml" />
<separator/>
<page id="embedding" label="Embedding" source="embedding.xml" />
+ <page id="extending" label="Extending" source="extending.xml" />
<separator/>
<page id="status" label="Status" source="status.xml" />
</book>
of a server side application such as <jump href="http://xml.apache.org/cocoon/index.html">Cocoon</jump>.
</p>
</s1>
+<s1 title="Settings">
+<s2 title="User Agent">
+<p>
+The user agent is responsible for supplying user or context
+specific information. The list of user agent values can be found on the
+<jump href="useragent.html">User Agent</jump> page.
+ </p>
+ </s2>
+<s2 title="Logging">
+<p>
+<ul>
+<li>logging level</li>
+<li>logging messages of various levels</li>
+<li>error handling</li>
+<li>Logging setup (LogKit, Log4J, JDK14Logging)</li>
+</ul>
+ </p>
+ </s2>
+<s2 title="XML input">
+<p>
+<ul>
+<li>various ways to supply FOP with the xsl:fo file, fo, xml+xsl</li>
+<li>sax handler</li>
+</ul>
+ </p>
+ </s2>
+<s2 title="general options">
+<p>
+<ul>
+<li>base directory</li>
+<li>uri resolvers</li>
+<li>which implementation of a particular</li>
+<li>LayoutManager to use</li>
+</ul>
+ </p>
+ </s2>
+<s2 title="Rendering Options">
+<p>
+<ul>
+<li>embedding fonts</li>
+<li>compression in pdf</li>
+<li>image embedding</li>
+</ul>
+</p>
+<p>
+for the PS renderer (eventually):
+<ul>
+<li>PostScript Level</li>
+<li>PPD to use</li>
+<li>binary/ascii switch</li>
+</ul>
+ </p>
+ </s2>
+<s2 title="User Agent">
+<p>
+Output from FOP:
+- Generation statistics: Number of pages total, Number of pages of each
+ page-sequence, page-master used for each page (could be used to
+ control the paper bin to get paper from, important for me in
+ conjunction with PS Renderer).
+ </p>
+ </s2>
+<s2 title="Setting Up">
+<p>
+The Driver handles the XML input.
+The user agent information is through the FOUserAgent.
+We could handle logging through the user agent.
+Options could also be handled through the user agent, using mime type
+selection for renderer options.
+</p>
+ </s2>
+<s2 title="Others">
+<p>
+render to more than one renderer at once (maybe not from the command line). Two independent
+sources have asked me in the last few weeks if this works. I must say
+that this would be nice, since I could generate a PDF for the archive
+and the PS for the printer in one run. It would probably be faster than
+converting the PDF to PostScript afterwards.
+</p>
+<p>
+I want to note that several code pieces for resolving URLs and/or
+file locations are scattered all over FOP and Batik. Replacing
+them all with an URIResolver invocation would unify behaviour and
+remove redundancies. I'd also recommend to lift the default
+URIResolver implementation from Saxon, it seems to tolerate the
+usual abuse better than everything else i came across elsewere.
+ </p>
+ </s2>
+</s1>
</body>
</document>
--- /dev/null
+<?xml version="1.0" standalone="no"?>
+
+<!-- Overview -->
+
+<document>
+ <header>
+ <title>FOP Extensions</title>
+ <subtitle>Adding extensions to FOP</subtitle>
+ <authors>
+ <person name="Keiron Liddle" email="keiron@aftexsw.com"/>
+ </authors>
+ </header>
+
+ <body>
+<s1 title="Extensions">
+<p>
+FOP provides an extension mechanism to add extra functionality. There
+are a number of different types of extensions that apply to different
+steps when converting FO into the rendered output.
+ </p>
+<s2 title="Extensions">
+ <p>
+SVG Graphic - This applies to svg and any other xml document that
+can be converted into svg in the output. All that is required is
+the element mapping for the xml and a converter that changes the
+document into svg. This conversion is done in the FO Tree. The
+conversion is done by the top level element of the namespace
+or in the case of an external image a Converter.
+ </p>
+ <p>
+XML Document - Instead of converting the document into svg it
+can be passed directly to the renderer. The renderer will need
+to have a handler for the xml document. This handler can add
+information directly to the output document.
+ </p>
+ <p>
+Output Document - This is used to add document level information
+to the output result. Such an extension will set information that
+is passed to the output document. There needs to be a handler for
+the output information which creates a document level result.
+ </p>
+ <p>
+FO Area - This is where an extension creates an normal area in
+the Area Tree. This is useful when the normal FO objects
+cannot create the area in the way that is needed.
+ </p>
+ <p>
+Resolveable - In some cases it may require information to be
+resolved for information such as page numbers. This can apply
+to the XML Document, FO Area or output document extensions.
+ </p>
+ <p>
+- Add a string ['(Continued)'] to a table header if the table spans
+multiple pages. These tables are part of the content and can start
+anywhere in the page.
+ </p>
+ <p>
+- Separate page number display for a subsection. ie. - master document
+is page 4 of 7, but subsection is page 2 of 3.
+
+ </p>
+</s2>
+<s2 title="Examples">
+ <p>
+Plan - The plan extension is a simple SVG graphic extension.
+Given a plan document either inside an InstreamForeignObject
+or as an external graphic, it converts the plan document into
+an svg graphic. The svg graphic is then passed through the
+Area Tree to the Renderer. The Renderer then renders the svg
+graphic as normal.
+ </p>
+ <p>
+PDF Outline - This is output document extension. If rendering to
+pdf and this extensionis used then the bookmark information is
+passed to the pdf document. This information is then set on the
+document.
+ </p>
+ <p>
+PDF Additions - This can be done with an XML Document extension.
+A simple xml document is defined that provides the appropriate
+information. When the document is rendered a handler converts the
+document into PDF markup.
+ </p>
+ <p>
+eg.
+<source><![CDATA[<my:script-link script="app.execMenuItem('AcroSrch:Query');">Search</my:script-link>]]></source>
+
+to result in a text box referencing the following PDF action:
+<source><![CDATA[<< /S /JavaScript /JS (app.execMenuItem("AcroSrch:Query");) >>]]></source>
+
+ </p>
+
+</s2>
+
+ </s1>
+
+ </body>
+</document>
+
<p>
Standard Features:
- <itemizedlist>
- <listitem><para>
+ <ul>
+ <li><p>
error handling, what to do if fo markup is invalid
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
auto overflow value and handling error-if-overflow
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
adjusting length values (eg. for borders) to renderable values
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
available fonts
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
converting cm/in to pt (dpi)
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
active state for multi properties
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
title, used to identify a set of pages (in a page sequence)
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
the width (in inline-progression-dimension) of a character with
treat-word-as-space true
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
maximum space used by conditional areas from region-reference-area
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
if there should be "hot links" to before floats or footnotes
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
when to clear side floats if space in inline-progression-dimension
is not enough
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
placement of left over footnotes on a page with a region-body
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
using color property as border colour
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
interpretting all border styles (except outset) as solid
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
thin, medium and thick values for border width
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
initial font-family value
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
absolute font sizes (eg, xx-small, x-small etc.)
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
relative font sizes (eg. larger, smaller)
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
small caps simulation
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
font weight mapping
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
baseline info for a font if not available
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
determining sub/superscript when another baseline is dominant
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
scaling method for external-graphic and instream-foreign-object
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
the width of a replaced element
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
"normal" line height value
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
text alignment (stretching the line with letter and word spacing)
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
text transform
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
initial color
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
rendering intent of auto
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
dot character for leader
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
line breaking with leaders, use optimum length when breaking the line
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
page height/width of auto
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
left and right caption widths
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
glyph orientation vertical of auto
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
rendering processor of content-type (mime type)
- </para></listitem>
- </itemizedlist>
+ </p></li>
+ </ul>
</p>
<p>
Interactive Features:
- <itemizedlist>
- <listitem><para>
+ <ul>
+ <li><p>
inline and block scroll amount
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
dynamic effects, links and property sets
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
initial "pause-after", "pause-before" and "voice-family" value
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
treating fixed as scroll on background attachement
- </para></listitem>
- <listitem><para>
+ </p></li>
+ <li><p>
media usage of auto
- </para></listitem>
- </itemizedlist>
+ </p></li>
+ </ul>
</p>
</s1>
<source><![CDATA[
userConfigFile = new File(userConfig);
options = new Options(userConfigFile);]]></source>
+ <note><p>
+ This is all you need to do, it sets up a static configuration class.
+ </p></note>
<p>Once the Driver is set up, the render method
is called. Depending on whether DOM or SAX is being used, the
information.
</p>
<p>
- For up to date information or more details please visit the Fop FAQ site.
- The site uses Jyve to provide an interactive FAQ:
- <jump href="http://www.owal.co.uk:8090/asf/servlet/asf/screen/DisplayTopics/action/SetAll/project_id/18/faq_id/276">http://www.OWAL.co.uk:8090/</jump>
+For up to date information or more details please visit the Fop FAQ site.
+<jump href="http://www.OWAL.co.uk/cgi-bin/fopfaq.cgi">http://www.OWAL.co.uk/cgi-bin/fopfaq.cgi</jump>
+ </p>
+ <p>
+Any problems with the FAQ itself or new answers for the FAQ should be mailed
+to info@OWAL.co.uk
+ </p>
+ <p>
+More general questions about FOP should be directed to one of the mailing
+lists.
</p>
</answer>
</faq>
<li>There is an xsl:fo mailing list: www-xsl-fo@w3.org. Subscription info can be found here: <jump href="http://www.w3.org/Mail/Request">
http://www.w3.org/Mail/Request</jump>. And the archive can be found here:
<jump href="http://lists.w3.org/Archives/Public/www-xsl-fo/">http://lists.w3.org/Archives/Public/www-xsl-fo/</jump></li>
+ <li>
+PJ is an open source product that can be used to modify PDF documents:
+<jump href="http://www.etymon.com/pj/index.html">http://www.etymon.com/pj/index.html</jump>
+ </li>
+ <li>
+iText is a library that can edit PDF files, it is possible to do
+post processing of the generated PDF files: <jump href="http://www.lowagie.com/iText/">http://www.lowagie.com/iText/</jump>.
+ </li>
</ul>
</s2>
</s1>