diff options
author | Kelly Campbell <kellyc@apache.org> | 2001-03-03 07:51:27 +0000 |
---|---|---|
committer | Kelly Campbell <kellyc@apache.org> | 2001-03-03 07:51:27 +0000 |
commit | 030b665bc57ebe17ca27b34caa6aec9b24087d66 (patch) | |
tree | 260768dcbbd875a032875d349994ba31f77d3089 /docs/xml-docs | |
parent | 506dc799d08fece47bd72f1d0ede606a80013c52 (diff) | |
download | xmlgraphics-fop-030b665bc57ebe17ca27b34caa6aec9b24087d66.tar.gz xmlgraphics-fop-030b665bc57ebe17ca27b34caa6aec9b24087d66.zip |
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
Diffstat (limited to 'docs/xml-docs')
-rw-r--r-- | docs/xml-docs/fop/embedding.xml | 34 | ||||
-rw-r--r-- | docs/xml-docs/fop/extensions.xml | 24 | ||||
-rwxr-xr-x | docs/xml-docs/makedoc.sh | 2 |
3 files changed, 37 insertions, 23 deletions
diff --git a/docs/xml-docs/fop/embedding.xml b/docs/xml-docs/fop/embedding.xml index ee70f75c7..5f6e46f94 100644 --- a/docs/xml-docs/fop/embedding.xml +++ b/docs/xml-docs/fop/embedding.xml @@ -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 diff --git a/docs/xml-docs/fop/extensions.xml b/docs/xml-docs/fop/extensions.xml index 8a8ae2b6c..d31ebae2a 100644 --- a/docs/xml-docs/fop/extensions.xml +++ b/docs/xml-docs/fop/extensions.xml @@ -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> diff --git a/docs/xml-docs/makedoc.sh b/docs/xml-docs/makedoc.sh index 5f6937fe8..c0876902c 100755 --- a/docs/xml-docs/makedoc.sh +++ b/docs/xml-docs/makedoc.sh @@ -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 |