aboutsummaryrefslogtreecommitdiffstats
path: root/docs/examples
diff options
context:
space:
mode:
authorKelly Campbell <kellyc@apache.org>2001-03-03 07:06:04 +0000
committerKelly Campbell <kellyc@apache.org>2001-03-03 07:06:04 +0000
commit506dc799d08fece47bd72f1d0ede606a80013c52 (patch)
tree381a245304b2a10722f585f51c072ed24d7d0a3f /docs/examples
parent9902c22a0e180d5a3cc8f683be8ebcbcd8a23c23 (diff)
downloadxmlgraphics-fop-506dc799d08fece47bd72f1d0ede606a80013c52.tar.gz
xmlgraphics-fop-506dc799d08fece47bd72f1d0ede606a80013c52.zip
Refactored Driver to simplify usage required for other apps
to integrate Fop. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194114 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/examples')
-rw-r--r--docs/examples/embedding/FopServlet.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/docs/examples/embedding/FopServlet.java b/docs/examples/embedding/FopServlet.java
index 56dbf9852..53a54ec27 100644
--- a/docs/examples/embedding/FopServlet.java
+++ b/docs/examples/embedding/FopServlet.java
@@ -114,17 +114,9 @@ public class FopServlet extends HttpServlet
response.setContentType("application/pdf");
- Driver driver = new Driver();
- driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",
- Version.getVersion());
- 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(out);
- driver.buildFOTree(createParser(), foFile);
- driver.format();
- driver.render();
+ Driver driver = new Driver(foFile, out);
+ driver.run();
+
byte[] content = out.toByteArray();
response.setContentLength(content.length);
response.getOutputStream().write(content);