From 506dc799d08fece47bd72f1d0ede606a80013c52 Mon Sep 17 00:00:00 2001 From: Kelly Campbell Date: Sat, 3 Mar 2001 07:06:04 +0000 Subject: 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 --- docs/examples/embedding/FopServlet.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'docs/examples') 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); -- cgit v1.2.3