Thanks for the info...I was also missing theDriver.Run(); DOH!!

Thanks again,
Brent

-----Original Message-----
From: Chris Bowditch [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 20, 2002 9:05 AM
To: [EMAIL PROTECTED]
Subject: Re: Another Logger Idiot.....



Hi Brent, see comments below

>I'm giving Embedding FOP a whirl and I get the following error:
>
>[ERROR] Logger not set
>
>It does generate a .pdf file, but it is 0k.
>
>I'm using fop-0.20.4rc, below is my code, thanks in advance - Brent!
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>import java.io.FileOutputStream;
>import java.io.FileInputStream;
>import org.apache.fop.apps.Driver;
>import org.apache.fop.messaging.MessageHandler;
>import org.apache.avalon.framework.logger.Logger;
>import org.apache.avalon.framework.logger.ConsoleLogger;
>import org.apache.avalon.framework.logger.NullLogger;
>import org.xml.sax.InputSource;
>
>class PdfMaker
>{
>       public static void main (String args[]) throws Exception
>       {
>               // Preferred Method of handling the logging, no need to
>log for my circumstance
>               Logger theLogger = new NullLogger();
>               Driver theDriver = new Driver();
>
>               theDriver.setRenderer(Driver.RENDER_PDF);
>
>               /*
>               theDriver.setInputSource(new InputSource(args[0]));
>               theDriver.setOutputStream(new
>FileOutputStream(args[1]));
>               */
>
>               theDriver.setInputSource(new InputSource("simple.fo"));
>               theDriver.setOutputStream(new
FileOutputStream("simple.pdf"));
                // you need to set null logger on message handler as
well
                MessageHandler.setScreenLogger(theLogger);
>               theDriver.setLogger(theLogger);
>
>               /* This doesn't work either, same message, same size pdf
>               Logger theLogger = new
ConsoleLogger(ConsoleLogger.LEVEL_INFO);
>               MessageHandler.setScreenLogger(theLogger);
>               theDriver.setLogger(theLogger );
>               */
>       }
>}
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail



Reply via email to