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-ffa450edef68pull/33/head
@@ -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("org.apache.fop.render.pdf.PDFRenderer", version);</FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced">driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");</FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced">driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");</FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced">driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping");</FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced">driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");</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"> </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 |
@@ -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"> </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> | |||
<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><FONT face="courier, monospaced"><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" | |||
xmlns:fox="http://xml.apache.org/fop/extensions"></FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced"><fox:outline internal-destination="sec3"></FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced"> <fox:label>Running FOP</fox:label></FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced"> <fox:outline internal-destination="sec3-1"></FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced"> <fox:label>Prerequisites</fox:label></FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced"> </fox:outline></FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced"><fox:outline></FONT></CODE></P> | |||
<P><CODE><FONT face="courier, monospaced"></fo:root></FONT></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> | |||
</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 © 1999 The Apache Software Foundation. |
@@ -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 |
@@ -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" | |||
   xmlns:fox="http://xml.apache.org/fop/extensions"> | |||
<fox:outline internal-destination="sec3"> | |||
   <fox:label>Running FOP</fox:label> | |||
<p><code><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" | |||
   xmlns:fox="http://xml.apache.org/fop/extensions"></code></p> | |||
<p><code><fox:outline internal-destination="sec3"></code></p> | |||
<p><code>   <fox:label>Running FOP</fox:label></code></p> | |||
<p><code>  <fox:outline internal-destination="sec3-1"></code></p> | |||
<p><code>    <fox:label>Prerequisites</fox:label></code></p> | |||
<p><code>  </fox:outline></code></p> | |||
<p><code><fox:outline></code></p> | |||
<p><code></fo:root></code></p> | |||
  <fox:outline internal-destination="sec3-1"> | |||
    <fox:label>Prerequisites</fox:label> | |||
  </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> | |||
@@ -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 |