xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r837993 [2/2] - in /websites/staging/xmlgraphics/trunk/content: ./ fop/ fop/1.0/ fop/1.1/ fop/trunk/
Date Sun, 11 Nov 2012 20:49:43 GMT
Modified: websites/staging/xmlgraphics/trunk/content/fop/trunk/intermediate.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/trunk/intermediate.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/trunk/intermediate.html Sun Nov 11 20:49:42
2012
@@ -372,8 +372,8 @@ Please note that the intermediate format
 </ul>
 <p>More technical information about the two formats can be found on the <a href="http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml/NewDesign">FOP
Wiki</a> .</p>
 <h2 id="architectural-overview-wzxhzdk14wzxhzdk15">Architectural Overview <a id="architecture"></a></h2>
-<p><figure alt="Diagram with an architectural overview over the intermediate formats"
src="images/if-architecture-overview.png"></figure></p>
-<h1 id="usage-of-the-area-tree-xml-format-at-xml-wzxhzdk18wzxhzdk19">Usage of the Area
Tree XML format (AT XML) <a id="usage"></a></h1>
+<p><img alt="Diagram with an architectural overview over the intermediate formats"
src="images/if-architecture-overview.png" /></p>
+<h1 id="usage-of-the-area-tree-xml-format-at-xml-wzxhzdk16wzxhzdk17">Usage of the Area
Tree XML format (AT XML) <a id="usage"></a></h1>
 <p>As already mentioned, the area tree XML format is generated by using the <strong>XMLRenderer</strong>
(MIME type: <strong>application/X-fop-areatree</strong> ). So, you basically set
the right MIME type for the output format and process your FO files as if you would create
a PDF file.</p>
 <p>However, there is an important detail to consider: The various Renderers don't all
use the same font sources. To be able to create the right area tree for the ultimate output
format, you need to create the area tree XML file using the right font setup. This is achieved
by telling the XMLRenderer to mimic another renderer. This is done by calling the XMLRenderer's
mimicRenderer() method with an instance of the ultimate target renderer as the single parameter.
This has a consequence: An area tree XML file rendered with the Java2DRenderer may not look
as expected when it was actually generated for the PDF renderer. For renderers that use the
same font setup, this restriction does not apply (PDF and PS, for example). Generating the
area tree XML format file is the first step.</p>
 <p>The second step is to reparse the file using the <strong>AreaTreeParser</strong>
which is found in the org.apache.fop.area package. The pages retrieved from the area tree
XML file are added to an AreaTreeModel instance from where they are normally rendered using
one of the available Renderer implementations. You can find examples for the area tree XML
processing in the <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"></a>
directory in the FOP distribution.</p>
@@ -406,14 +406,14 @@ try {
 }
 This example simply reads an area tree file and renders it to a PDF file. Please note, that
in normal FOP operation you're shielded from having to instantiate the FontInfo object yourself.
This is normally a task of the AreaTreeHandler which is not present in this scenario. The
same applies to the AreaTreeModel instance, in this case an instance of a subclass called
RenderPagesModel. RenderPagesModel is ideal in this case as it has very little overhead processing
the individual pages. An important line in the example is the call to <code>endDocument()</code>
on the AreaTreeModel. This lets the Renderer know that the processing is now finished.</p>
 <p>The area tree XML format can also be used from the <a href="running.html#standalone-start">command-line</a>
by using the "-atin" parameter for specifying the area tree XML as input file. You can also
specify a "mimic renderer" by inserting a MIME type between "-at" and the output file.</p>
-<h3 id="concatenating-documents-wzxhzdk20wzxhzdk21">Concatenating Documents <a id="concat"></a></h3>
+<h3 id="concatenating-documents-wzxhzdk18wzxhzdk19">Concatenating Documents <a id="concat"></a></h3>
 <p>This initial example is obviously not very useful. It would be faster to create
the PDF file directly. As the <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/atxml/ExampleConcat.java">ExampleConcat.java</a>
example shows you can easily parse multiple area tree files in a row and add the parsed pages
to the same AreaTreeModel instance which essentially concatenates all the input document to
one single output document.</p>
-<h3 id="modifying-documents-wzxhzdk22wzxhzdk23">Modifying Documents <a id="modifying"></a></h3>
+<h3 id="modifying-documents-wzxhzdk20wzxhzdk21">Modifying Documents <a id="modifying"></a></h3>
 <p>One of the most important use cases for this format is obviously modifying the area
tree XML before finally rendering it to the target format. You can easily use XSLT to process
the AT XML file according to your needs. Please note, that we will currently not formally
describe the area tree XML format. You need to have a good understanding its structure so
you don't create any non-parseable files. We may add an XML Schema and more detailed documentation
at a later time. You're invited to help us with that.
 The area tree XML format is sensitive to changes in whitespace. If you're not careful, the
modified file may not render correctly.</p>
-<h2 id="advanced-use-wzxhzdk24wzxhzdk25">Advanced Use <a id="advanced"></a></h2>
+<h2 id="advanced-use-wzxhzdk22wzxhzdk23">Advanced Use <a id="advanced"></a></h2>
 <p>The generation of the area tree format as well as it parsing process has been designed
to allow for maximum flexibility and optimization. Please note that you can call <code>setTransformerHandler()</code>
on XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would
like to do custom serialization (to a W3C DOM, for example) and/or to directly modify the
area tree using XSLT. The AreaTreeParser on the other side allows you to retrieve a ContentHandler
instance where you can manually send SAX events to to start the parsing process (see <code>getContentHandler()</code>
).</p>
-<h2 id="usage-of-the-intermediate-format-if-wzxhzdk26wzxhzdk27">Usage of the Intermediate
Format (IF) <a id="usage-if"></a></h2>
+<h2 id="usage-of-the-intermediate-format-if-wzxhzdk24wzxhzdk25">Usage of the Intermediate
Format (IF) <a id="usage-if"></a></h2>
 <p>The Intermediate Format (IF) is generated by the <strong>IFSerializer</strong>
(MIME type: <strong>application/X-fop-intermediate-format</strong> ). So, you
basically set the right MIME type for the output format and process your FO files as if you
would create a PDF file.</p>
 <p>The IFSerializer is an implementation of the <strong>IFDocumentHandler</strong>
and <strong>IFPainter</strong> interfaces. The <strong>IFRenderer</strong>
class is responsible for converting FOP's area tree into calls against these two interfaces.</p>
 <ul>
@@ -457,13 +457,13 @@ try {
     out.close();
 }
 This example simply reads an intermediate file and renders it to a PDF file. Here IFParser.parse()
is used, but you can also just get a SAX ContentHandler by using the IFParser.getContentHandler()
method.</p>
-<h3 id="concatenating-documents-wzxhzdk28wzxhzdk29">Concatenating Documents <a id="concat-if"></a></h3>
+<h3 id="concatenating-documents-wzxhzdk26wzxhzdk27">Concatenating Documents <a id="concat-if"></a></h3>
 <p>This initial example is obviously not very useful. It would be faster to create
the PDF file directly (without the intermediate step). As the <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java">ExampleConcat.java</a>
example shows you can easily parse multiple intermediate files in a row and use the IFConcatenator
class to concatenate page sequences from multiple source files to a single output file. This
particular example does the concatenation on the level of the IFDocumentHandler interface.
You could also do this in XSLT or using SAX on the XML level. Whatever suits your process
best.</p>
-<h3 id="modifying-documents-wzxhzdk30wzxhzdk31">Modifying Documents <a id="modifying-if"></a></h3>
+<h3 id="modifying-documents-wzxhzdk28wzxhzdk29">Modifying Documents <a id="modifying-if"></a></h3>
 <p>One of the most important use cases for this format is obviously modifying the intermediate
format before finally rendering it to the target format. You can easily use XSLT to process
the IF file according to your needs.</p>
 <p>There is an XML Schema (located under <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/">src/documentation/intermediate-format-ng</a>
) that helps you verify that your modified content is correct.</p>
 <p>For certain output formats there's a caveat: Formats like AFP and PCL do not support
arbitrary transformations on the IF's "viewport" and "g" elements. Possible are only rotations
in 90 degree steps and translations.</p>
-<h3 id="advanced-use-wzxhzdk32wzxhzdk33">Advanced Use <a id="advanced-if"></a></h3>
+<h3 id="advanced-use-wzxhzdk30wzxhzdk31">Advanced Use <a id="advanced-if"></a></h3>
 <p>The generation of the intermediate format as well as it parsing process has been
designed to allow for maximum flexibility and optimization. So rather than just passing in
a StreamResult to IFSerializer's setResult() method, you can also use a SAXResult or a DOMResult.
And as you've already seen , the IFParser on the other side allows you to retrieve a ContentHandler
instance where you can manually send SAX events to start the parsing process (see <code>getContentHandler()</code>
).</p></div>
       </div>
       



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message