I've searched the mailing list and looked at the Docs and I am just
missing something I guess.

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"));                        
                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 );
                */
        }
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Reply via email to