diff options
Diffstat (limited to 'examples/embedding')
5 files changed, 25 insertions, 25 deletions
diff --git a/examples/embedding/java/embedding/ExampleDOM2PDF.java b/examples/embedding/java/embedding/ExampleDOM2PDF.java index 372ff274a..783c7a7ad 100644 --- a/examples/embedding/java/embedding/ExampleDOM2PDF.java +++ b/examples/embedding/java/embedding/ExampleDOM2PDF.java @@ -40,7 +40,7 @@ import org.w3c.dom.Node; import org.w3c.dom.Text; // FOP -import org.apache.fop.apps.Driver; +import org.apache.fop.apps.Fop; /** @@ -61,15 +61,15 @@ public class ExampleDOM2PDF { */ public void convertDOM2PDF(Document xslfoDoc, File pdf) { try { - // Construct driver with desired output format - Driver driver = new Driver(Driver.RENDER_PDF); + // Construct fop with desired output format + Fop fop = new Fop(Fop.RENDER_PDF); // Setup output OutputStream out = new java.io.FileOutputStream(pdf); out = new java.io.BufferedOutputStream(out); try { - driver.setOutputStream(out); + fop.setOutputStream(out); // Setup Identity Transformer TransformerFactory factory = TransformerFactory.newInstance(); @@ -79,7 +79,7 @@ public class ExampleDOM2PDF { Source src = new DOMSource(xslfoDoc); // Resulting SAX events (the generated FO) must be piped through to FOP - Result res = new SAXResult(driver.getDefaultHandler()); + Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(src, res); diff --git a/examples/embedding/java/embedding/ExampleFO2PDF.java b/examples/embedding/java/embedding/ExampleFO2PDF.java index 2cac20729..388cdcaf4 100644 --- a/examples/embedding/java/embedding/ExampleFO2PDF.java +++ b/examples/embedding/java/embedding/ExampleFO2PDF.java @@ -35,7 +35,7 @@ import javax.xml.transform.sax.SAXResult; // FOP -import org.apache.fop.apps.Driver; +import org.apache.fop.apps.Fop; import org.apache.fop.apps.FOPException; /** @@ -55,14 +55,14 @@ public class ExampleFO2PDF { OutputStream out = null; try { - // Construct driver with desired output format - Driver driver = new Driver(Driver.RENDER_PDF); + // Construct fop with desired output format + Fop fop = new Fop(Fop.RENDER_PDF); // Setup output stream. Note: Using BufferedOutputStream // for performance reasons (helpful with FileOutputStreams). out = new FileOutputStream(pdf); out = new BufferedOutputStream(out); - driver.setOutputStream(out); + fop.setOutputStream(out); // Setup JAXP using identity transformer TransformerFactory factory = TransformerFactory.newInstance(); @@ -72,7 +72,7 @@ public class ExampleFO2PDF { Source src = new StreamSource(fo); // Resulting SAX events (the generated FO) must be piped through to FOP - Result res = new SAXResult(driver.getDefaultHandler()); + Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(src, res); diff --git a/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java b/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java index de152b125..612f78974 100644 --- a/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java +++ b/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java @@ -36,7 +36,7 @@ import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.SAXException; // FOP -import org.apache.fop.apps.Driver; +import org.apache.fop.apps.Fop; import org.apache.fop.apps.FOPException; /** @@ -63,14 +63,14 @@ public class ExampleFO2PDFUsingSAXParser { OutputStream out = null; try { - // Construct driver and setup output format - Driver driver = new Driver(Driver.RENDER_PDF); + // Construct fop and setup output format + Fop fop = new Fop(Fop.RENDER_PDF); // Setup output stream. Note: Using BufferedOutputStream // for performance reasons (helpful with FileOutputStreams). out = new FileOutputStream(pdf); out = new BufferedOutputStream(out); - driver.setOutputStream(out); + fop.setOutputStream(out); // Setup SAX parser // throws FactoryConfigurationError @@ -81,7 +81,7 @@ public class ExampleFO2PDFUsingSAXParser { // Obtain FOP's DefaultHandler // throws FOPException - DefaultHandler dh = driver.getDefaultHandler(); + DefaultHandler dh = fop.getDefaultHandler(); // Start parsing and FOP processing // throws SAXException, IOException diff --git a/examples/embedding/java/embedding/ExampleObj2PDF.java b/examples/embedding/java/embedding/ExampleObj2PDF.java index e68bc69c8..ba3b99f77 100644 --- a/examples/embedding/java/embedding/ExampleObj2PDF.java +++ b/examples/embedding/java/embedding/ExampleObj2PDF.java @@ -33,7 +33,7 @@ import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; // FOP -import org.apache.fop.apps.Driver; +import org.apache.fop.apps.Fop; import org.apache.fop.apps.FOPException; import embedding.model.ProjectTeam; @@ -55,14 +55,14 @@ public class ExampleObj2PDF { public void convertProjectTeam2PDF(ProjectTeam team, File xslt, File pdf) throws IOException, FOPException, TransformerException { - // Construct driver with desired output format - Driver driver = new Driver(Driver.RENDER_PDF); + // Construct fop with desired output format + Fop fop = new Fop(Fop.RENDER_PDF); // Setup output OutputStream out = new java.io.FileOutputStream(pdf); out = new java.io.BufferedOutputStream(out); try { - driver.setOutputStream(out); + fop.setOutputStream(out); // Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); @@ -72,7 +72,7 @@ public class ExampleObj2PDF { Source src = team.getSourceForProjectTeam(); // Resulting SAX events (the generated FO) must be piped through to FOP - Result res = new SAXResult(driver.getDefaultHandler()); + Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(src, res); diff --git a/examples/embedding/java/embedding/ExampleXML2PDF.java b/examples/embedding/java/embedding/ExampleXML2PDF.java index fa99b843e..3f82b3e94 100644 --- a/examples/embedding/java/embedding/ExampleXML2PDF.java +++ b/examples/embedding/java/embedding/ExampleXML2PDF.java @@ -32,7 +32,7 @@ import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP -import org.apache.fop.apps.Driver; +import org.apache.fop.apps.Fop; import org.apache.fop.apps.FOPException; /** @@ -66,15 +66,15 @@ public class ExampleXML2PDF { System.out.println(); System.out.println("Transforming..."); - // Construct driver with desired output format - Driver driver = new Driver(Driver.RENDER_PDF); + // Construct fop with desired output format + Fop fop = new Fop(Fop.RENDER_PDF); // Setup output OutputStream out = new java.io.FileOutputStream(pdffile); out = new java.io.BufferedOutputStream(out); try { - driver.setOutputStream(out); + fop.setOutputStream(out); // Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); @@ -87,7 +87,7 @@ public class ExampleXML2PDF { Source src = new StreamSource(xmlfile); // Resulting SAX events (the generated FO) must be piped through to FOP - Result res = new SAXResult(driver.getDefaultHandler()); + Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(src, res); |