import java.io.*; import org.xml.sax.*;
import org.apache.fop.apps.*; import org.apache.fop.messaging.*; import org.apache.avalon.framework.logger.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class Produce { public void generate() { Logger log = null; try { log = new ConsoleLogger(ConsoleLogger.LEVEL_WARN); MessageHandler.setScreenLogger(log); XSLTInputHandler input = new XSLTInputHandler(new File("helloworld.xml"),new Fil e("helloworld.xsl")); ByteArrayOutputStream out = new ByteArrayOutputStream(); Driver driver = new Driver(); driver.setLogger(log); driver.setRenderer(Driver.RENDER_MIF); driver.setOutputStream(out); driver.render(input.getParser(), input.getInputSource()); byte[] content = out.toByteArray(); FileOutputStream fos = new FileOutputStream("helloworld.pdf"); fos.write(content); }catch(Exception e) { System.out.println("Exception is " + e); } } public static void main(String a[]) { new Produce().generate(); } } for this u have give xml and xsl file for input and it produce pdf as output. with love jamal >From: [EMAIL PROTECTED] >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Re: How to Call FOP thro Java Application? >Date: Fri, 9 Aug 2002 09:07:48 +0200 (MEST) > >I have t work on that too. >If you have an example of a standalone application which calls fop please >post the code. > > >Thanks a lot! > >Markus Schäffler >------------------------------------------------------ > > Inside servlet or standalone tell me, i will send the code > > > > > > > > >From: Amerin Szulr <[EMAIL PROTECTED]> > > >Reply-To: [EMAIL PROTECTED] > > >To: [EMAIL PROTECTED] > > >Subject: How to Call FOP thro Java Application? > > >Date: Thu, 8 Aug 2002 02:48:04 -0700 (PDT) > > > > > > > > >Hi > > > > > >How to Call FOP from Java Application? > > > > > >Thnx in advance. > > > > > > > > > > > > > > > > > >--------------------------------- > > >Do You Yahoo!? > > >HotJobs, a Yahoo! service - Search Thousands of New Jobs > > > > > > > > > > _________________________________________________________________ > > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, email: [EMAIL PROTECTED] > > > >-- >GMX - Die Kommunikationsplattform im Internet. >http://www.gmx.net > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, email: [EMAIL PROTECTED] _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]