I have a problem with RENDER_TXT (FOP 0.20.5rc):

error message to the line : driver.render(input.getParser(),input.getInputSource());

“java.lang.RuntimeException : java.lang.nullPointerException”

 

all functions with that :

driver.setRenderer(Driver.RENDER_PDF);

driver.setRenderer(Driver.RENDER_PCL);

 

but not with :

driver.setRenderer(Driver.RENDER_TXT);

 

did somebody already have this problem?

 

 

My code :

----------------------------------------------------------------------------------------------------

Logger theLogger = new NullLogger();

XSLTInputHandler input = new XSLTInputHandler(new File(xml),new File(xsl));

ByteArrayOutputStream out = new ByteArrayOutputStream();

Driver driver = new Driver();

 

Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();

PatternFormatter formatter = new PatternFormatter(      "[%{priority}]: %{message}\n%{throwable}" );

LogTarget target = null;

FileOutputStream err = new FileOutputStream(sansExtensionResultat+".log");

PrintStream errPrintStream = new PrintStream(err);

target = new StreamTarget(errPrintStream, formatter);

                                   

hierarchy.setDefaultLogTarget(target);

log = hierarchy.getLoggerFor("fop");

log.setPriority(Priority.INFO);

 

MessageHandler.setScreenLogger(theLogger);

driver.setLogger(new org.apache.avalon.framework.logger.LogKitLogger(log));

                      

driver.setRenderer(Driver.RENDER_PDF);

driver.setOutputStream(out);

 

driver.render(input.getParser(),input.getInputSource());

 

byte[] content = out.toByteArray();

FileOutputStream fos = new FileOutputStream(pdf);

 

fos.write(content);

           

Reply via email to