You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Kenneth Trio <Ke...@eng.sun.com> on 2001/06/30 03:13:56 UTC
Question on Generating PDF from a Servlet
I'm trying to generate PDF from a Servlet by giving providing XML and XSL files
as input. I used the following code with some modifications:
ByteArrayOutputStream out = new ByteArrayOutputStream();
response.setContentType("application/pdf");
Driver driver = new Driver();
driver.setRenderer(Driver.RENDER_PDF);
InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
XMLReader parser = inputHandler.getParser();
driver.buildFOTree(parser, inputHandler);
driver.format();
driver.setOutputStream( out );
driver.render();
byte[] content = out.toByteArray();
response.setContentLength(content.length);
response.getOutputStream().write(content);
response.getOutputStream().flush();*/
PDF cannot be generated as I received an InvocationTargetException in the
getParser() method of 'XSLTInputHandler.java' in the org.apache.fop.apps
package.
Any help will be greatly appreciated. Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org