xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willis, Matthew" <mwil...@jhancock.com>
Subject RE: How to generate PDF from a java class...
Date Thu, 01 May 2003 14:27:16 GMT
Hi,

You can use something like the following code to "embed" fop in a Java
class:

Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PDF);

InputHandler inputHandler = new XSLTInputHandler(new File(XML_PO_FILE_PATH),

                                                 new
File(XSL_FO_FILE_PATH));
XMLReader parser = inputHandler.getParser();

driver.setOutputStream(new FileOutputStream(PDF_FILE_PATH));
driver.render(parser, inputHandler.getInputSource());

This is also documented in:  http://xml.apache.org/fop/embedding.html, and
in more detail in the example embedded code provided with the distribution.

Good luck!

Matt


-----Original Message-----
From: Kumar, Hemanth [mailto:Hemanth.Kumar@erac.com] 
Sent: Thursday, May 01, 2003 10:18 AM
To: 'fop-user@xml.apache.org'
Subject: How to generate PDF from a java class...


Hello,

I have an XML and xsl files available, and I'm generating xsl.fo thru
Transformer class,Now to generate PDF do I invoke Fop.main(String
args[])from 
my java class or does FOP comes with any other API.

I appreciate your help.

thanks
hkumar

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Mime
View raw message