From 030b665bc57ebe17ca27b34caa6aec9b24087d66 Mon Sep 17 00:00:00 2001 From: Kelly Campbell Date: Sat, 3 Mar 2001 07:51:27 +0000 Subject: [PATCH] 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 --- docs/html-docs/embedding.html | 34 +++++++++++++++++++++----------- docs/html-docs/extensions.html | 24 +++++++++++----------- docs/xml-docs/fop/embedding.xml | 34 +++++++++++++++++++++----------- docs/xml-docs/fop/extensions.xml | 24 +++++++++++----------- docs/xml-docs/makedoc.sh | 2 +- 5 files changed, 73 insertions(+), 45 deletions(-) diff --git a/docs/html-docs/embedding.html b/docs/html-docs/embedding.html index 4c2de2ebf..6254d9cef 100644 --- a/docs/html-docs/embedding.html +++ b/docs/html-docs/embedding.html @@ -33,6 +33,20 @@ instantiate the class itself. The advantage of the latter is it enables runtime determination of Renderer and ElementMapping(s).

+

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. +

+

Here is an example use of Driver which outputs PDF: +

+
+   Driver driver = new Driver(new InputSource (args[0]), 
+                              new FileOutputStream(args[1]));
+   driver.setRenderer(RENDER_PDF);
+   driver.run();
+
+ +

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.

Here is an example use of Driver:

-

Driver driver = new Driver();

-

driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version);

-

driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");

-

driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");

-

driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping");

-

driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");

-

driver.setOutputStream(new FileOutputStream(args[1]));

-

driver.buildFOTree(parser, fileInputSource(args[0]));

-

driver.format();

-

driver.render();

-

Have a look at the classes CommandLine or XalanCommandLine for complete examples.

+
+  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();
+
+

Have a look at the classes CommandLineStarter or FopServlet for complete examples.


Using Fop in a servlet
 

In the directory xml-fop/docs/examples/embedding you can find a working example how to use diff --git a/docs/html-docs/extensions.html b/docs/html-docs/extensions.html index 5f77ef63d..4ffe06d43 100644 --- a/docs/html-docs/extensions.html +++ b/docs/html-docs/extensions.html @@ -29,19 +29,21 @@
Bookmarks
 

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:

+
+    <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>
 
-    

<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>

- -

  <fox:outline internal-destination="sec3-1">

-

    <fox:label>Prerequisites</fox:label>

-

  </fox:outline>

-

<fox:outline>

-

</fo:root>

+ &#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> +

It works similarly to a basic-link. There is also an external-destination - property, but it isn't supported currently.

+ property, but it isn't supported currently. See the pdfoutline.fo file in + docs/examples/fo for a more complete example.



Copyright © 1999 The Apache Software Foundation. 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).

+

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. +

+

Here is an example use of Driver which outputs PDF: +

+ + +

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.

Here is an example use of Driver:

-

Driver driver = new Driver();

-

driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version);

-

driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");

-

driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");

-

driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping");

-

driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");

-

driver.setOutputStream(new FileOutputStream(args[1]));

-

driver.buildFOTree(parser, fileInputSource(args[0]));

-

driver.format();

-

driver.render();

-

Have a look at the classes CommandLine or XalanCommandLine for complete examples.

+ +

Have a look at the classes CommandLineStarter or FopServlet for complete examples.

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 @@

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:

+ + + +    Running FOP -

<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>

- -

  <fox:outline internal-destination="sec3-1">

-

    <fox:label>Prerequisites</fox:label>

-

  </fox:outline>

-

<fox:outline>

-

</fo:root>

+    +     Prerequisites +    + + +]]>

It works similarly to a basic-link. There is also an external-destination - property, but it isn't supported currently.

+ property, but it isn't supported currently. See the pdfoutline.fo file in + docs/examples/fo for a more complete example.

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 -- 2.39.5