Apologies if MIF is some sort of PDF. If not, then surely that should be
driver.setRenderer(Driver.RENDER_PDF);
I think directing people to http://xml.apache.org/fop/embedding.html really
ought to be enough in future.
- Keith
-----Original Message-----
From: Jamal Mohamed A Abdul Sathar
To: [EMAIL PROTECTED]
Sent: 09/08/02 14:20
Subject: Re: How to Call FOP thro Java Application?
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]
Evolution is the investment banking and venture
capital industry's first choice for practical advice
on strategy, business process and the application of
advanced technology.
Evolution Tel: +44 (0) 20 7664 6640
Peninsular House Fax: +44 (0) 20 7664 6641
30-36 Monument Street
London EC3R 8LJ URL: http://www.evolution.net
United Kingdom
______________________________________________________
The information in this Internet e-mail is confidential
and is intended solely for the addressee. Access,
copying or re-use of information in it by anyone else
is unauthorised. Any views or opinions presented are
solely those of the author and do not necessarily
represent those of Evolution or any of its affiliates.
If you are not the intended recipient please contact
Evolution, London, +44 (0) 20 7664 6640
_____________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]