I think you need something like this:
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(new FileOutputStream(outFile));
driver.render();
This information will be one the website when next updated...
> >
> > maybe this is a silly question, but I hope someone can give me a hint:
> >
> > I have a XSL stylesheet, say foo.xsl, and dynamically
> > generated xml files,
> > say foo.xml. Now I want to create a PDF document which works fine via
> > command line parameters <fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf>.
> >
> > How do I generate the pdf document within my application?
> > If tried
> >
> > org.apache.fop.apps.Driver driver = new Driver(new
> > org.xml.sax.InputSource(new FileInputStream("foo.xml")), new
> > FileOutputStream("foo.pdf");
> > driver.setRenderer(driver.RENDER_PDF);
> > driver.run();
> >
> > But where do I say to use the foo.xsl?
> >
> > Any help is greatly appreciated,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]