Pārlūkot izejas kodu

Updated docs for new Driver.

Added reference to pdfoutline.fo example
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194115 13f79535-47bb-0310-9956-ffa450edef68
pull/33/head
Kelly Campbell pirms 23 gadiem
vecāks
revīzija
1d5f26d596

+ 23
- 11
docs/html-docs/embedding.html Parādīt failu

@@ -33,6 +33,20 @@
instantiate the class itself. The advantage of the latter is it
enables runtime determination of Renderer and ElementMapping(s).
</P>
<P>The simplest way to use Driver is to instantiate it with the
InputSource and OutputStream, then set the renderer desired and
call the run method.
</P>
<P>Here is an example use of Driver which outputs PDF:
</P>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>
Driver driver = new Driver(new InputSource (args[0]),
new FileOutputStream(args[1]));
driver.setRenderer(RENDER_PDF);
driver.run();
</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>


<P>Once the Driver is set up, the buildFOTree method
is called. Depending on whether DOM or SAX is being used, the
invocation of the method is either buildFOTree(Document) or
@@ -45,17 +59,15 @@
called in that order.
</P>
<P>Here is an example use of Driver:</P>
<P><CODE><FONT face="courier, monospaced">Driver driver = new Driver();</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.setRenderer(&quot;org.apache.fop.render.pdf.PDFRenderer&quot;, version);</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.addElementMapping(&quot;org.apache.fop.fo.StandardElementMapping&quot;);</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.addElementMapping(&quot;org.apache.fop.svg.SVGElementMapping&quot;);</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.addPropertyList(&quot;org.apache.fop.fo.StandardPropertyListMapping&quot;);</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.addPropertyList(&quot;org.apache.fop.svg.SVGPropertyListMapping&quot;);</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.setOutputStream(new FileOutputStream(args[1]));</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.buildFOTree(parser, fileInputSource(args[0]));</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.format();</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">driver.render();</FONT></CODE></P>
<P>Have a look at the classes CommandLine or XalanCommandLine for complete examples.</P>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>
Driver driver = new Driver();
driver.setRenderer(Driver.RENDER_PDF);
driver.buildFOTree(parser, fileInputSource(args[0]));
driver.format();
driver.setOutputStream(new FileOutputStream(args[1]));
driver.render();
</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
<P>Have a look at the classes CommandLineStarter or FopServlet for complete examples.</P>
</FONT></TD></TR></TABLE><BR>
<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Using Fop in a servlet</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
<P>In the directory xml-fop/docs/examples/embedding you can find a working example how to use

+ 13
- 11
docs/html-docs/extensions.html Parādīt failu

@@ -29,19 +29,21 @@
<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Bookmarks</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
<P>You can provide outlines inside the root object (but outside any page-sequences or
other formatting objects). Here's an example of an outline entry:</P>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>
&lt;fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;
&amp;#160;&amp;#160; xmlns:fox=&quot;http://xml.apache.org/fop/extensions&quot;&gt;
&lt;fox:outline internal-destination=&quot;sec3&quot;&gt;
&amp;#160;&amp;#160; &lt;fox:label&gt;Running FOP&lt;/fox:label&gt;

<P><CODE><FONT face="courier, monospaced">&lt;fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;
&nbsp;&nbsp; xmlns:fox=&quot;http://xml.apache.org/fop/extensions&quot;&gt;</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">&lt;fox:outline internal-destination=&quot;sec3&quot;&gt;</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">&nbsp;&nbsp; &lt;fox:label&gt;Running FOP&lt;/fox:label&gt;</FONT></CODE></P>

<P><CODE><FONT face="courier, monospaced">&nbsp;&nbsp;&lt;fox:outline internal-destination=&quot;sec3-1&quot;&gt;</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">&nbsp;&nbsp;&nbsp;&nbsp;&lt;fox:label&gt;Prerequisites&lt;/fox:label&gt;</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">&nbsp;&nbsp;&lt;/fox:outline&gt;</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">&lt;fox:outline&gt;</FONT></CODE></P>
<P><CODE><FONT face="courier, monospaced">&lt;/fo:root&gt;</FONT></CODE></P>
&amp;#160;&amp;#160;&lt;fox:outline internal-destination=&quot;sec3-1&quot;&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;fox:label&gt;Prerequisites&lt;/fox:label&gt;
&amp;#160;&amp;#160;&lt;/fox:outline&gt;
&lt;fox:outline&gt;
&lt;/fo:root&gt;
</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
<P>It works similarly to a basic-link. There is also an external-destination
property, but it isn't supported currently.</P>
property, but it isn't supported currently. See the pdfoutline.fo file in
docs/examples/fo for a more complete example.</P>
</FONT></TD></TR></TABLE><BR>
</TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT color="#0086b2" size="-1"><I>
Copyright &copy; 1999 The Apache Software Foundation.

+ 23
- 11
docs/xml-docs/fop/embedding.xml Parādīt failu

@@ -16,6 +16,20 @@
instantiate the class itself. The advantage of the latter is it
enables runtime determination of Renderer and ElementMapping(s).
</p>
<p>The simplest way to use Driver is to instantiate it with the
InputSource and OutputStream, then set the renderer desired and
call the run method.
</p>
<p>Here is an example use of Driver which outputs PDF:
</p>
<source><![CDATA[
Driver driver = new Driver(new InputSource (args[0]),
new FileOutputStream(args[1]));
driver.setRenderer(RENDER_PDF);
driver.run();
]]></source>


<p>Once the Driver is set up, the buildFOTree method
is called. Depending on whether DOM or SAX is being used, the
invocation of the method is either buildFOTree(Document) or
@@ -28,17 +42,15 @@
called in that order.
</p>
<p>Here is an example use of Driver:</p>
<p><code>Driver driver = new Driver();</code></p>
<p><code>driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version);</code></p>
<p><code>driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");</code></p>
<p><code>driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");</code></p>
<p><code>driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping");</code></p>
<p><code>driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");</code></p>
<p><code>driver.setOutputStream(new FileOutputStream(args[1]));</code></p>
<p><code>driver.buildFOTree(parser, fileInputSource(args[0]));</code></p>
<p><code>driver.format();</code></p>
<p><code>driver.render();</code></p>
<p>Have a look at the classes CommandLine or XalanCommandLine for complete examples.</p>
<source><![CDATA[
Driver driver = new Driver();
driver.setRenderer(Driver.RENDER_PDF);
driver.buildFOTree(parser, fileInputSource(args[0]));
driver.format();
driver.setOutputStream(new FileOutputStream(args[1]));
driver.render();
]]></source>
<p>Have a look at the classes CommandLineStarter or FopServlet for complete examples.</p>
</s2>
<s2 title="Using Fop in a servlet">
<p>In the directory xml-fop/docs/examples/embedding you can find a working example how to use

+ 13
- 11
docs/xml-docs/fop/extensions.xml Parādīt failu

@@ -9,19 +9,21 @@
<s2 title="Bookmarks">
<p>You can provide outlines inside the root object (but outside any page-sequences or
other formatting objects). Here's an example of an outline entry:</p>
<source>
<![CDATA[<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
&#160;&#160; xmlns:fox="http://xml.apache.org/fop/extensions">
<fox:outline internal-destination="sec3">
&#160;&#160; <fox:label>Running FOP</fox:label>

<p><code>&lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
&#160;&#160; xmlns:fox="http://xml.apache.org/fop/extensions"></code></p>
<p><code>&lt;fox:outline internal-destination="sec3"></code></p>
<p><code>&#160;&#160; &lt;fox:label>Running FOP&lt;/fox:label></code></p>

<p><code>&#160;&#160;&lt;fox:outline internal-destination="sec3-1"></code></p>
<p><code>&#160;&#160;&#160;&#160;&lt;fox:label>Prerequisites&lt;/fox:label></code></p>
<p><code>&#160;&#160;&lt;/fox:outline></code></p>
<p><code>&lt;fox:outline></code></p>
<p><code>&lt;/fo:root></code></p>
&#160;&#160;<fox:outline internal-destination="sec3-1">
&#160;&#160;&#160;&#160;<fox:label>Prerequisites</fox:label>
&#160;&#160;</fox:outline>
<fox:outline>
</fo:root>
]]></source>
<p>It works similarly to a basic-link. There is also an external-destination
property, but it isn't supported currently.</p>
property, but it isn't supported currently. See the pdfoutline.fo file in
docs/examples/fo for a more complete example.</p>
</s2>
</s1>


+ 1
- 1
docs/xml-docs/makedoc.sh Parādīt failu

@@ -13,7 +13,7 @@ if [ "$JAVA_HOME" = "" ] ; then
exit 1
fi

LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/classes.zip:../../lib/ant.jar:../../lib/w3c.jar:../../lib/buildtools.jar:../../build/fop.jar:../../lib\stylebook.jar
LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/classes.zip:../../lib/ant.jar:../../lib/w3c.jar:../../lib/buildtools.jar:../../build/fop.jar:../../lib/stylebook.jar
ANT_HOME=../../lib

echo Building with classpath $CLASSPATH:$LOCALCLASSPATH

Notiek ielāde…
Atcelt
Saglabāt