Looking at your code I am guessing that you wrote the fo file out to the filesystem and then used the driver to convert it to PDF...how is performance on that?
Instead of writing the file out to the file system did you try converting into some sorta stream and use the driver??

thanks for your help
Amit

Semprini Davide wrote:

Hi,

I have had the same problem!!!!!!!!
Nobody give me a response!

This code in FOP Home page don't work (for me!) !!!!!

Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PDF);
  InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
  XMLReader parser = inputHandler.getParser();
  driver.setOutputStream(new FileOutputStream(outFile));
  driver.render(parser, inputHandler.getInputSource());


I have solved the problem using 2 phase:

1) generate the transformation using XSLTrasform, Xalan1Transform etc... (you can choose)
code:

XSLTransform traXSLT = new XSLTransform();
traXSLT.transform(urlXML, urlXSL, urlFoFile);

You can choose 4 transform type (see the api documentation)

2) Apply the result at the driver

FileInputStream file = new FileInputStream(urlFoFile);

    response.setContentType("application/pdf");

    Driver driver = new Driver(new InputSource(file), out);
    driver.setRenderer(Driver.RENDER_PDF);
    driver.run();
    byte[] content = out.toByteArray();
    response.setContentLength(content.length);
    response.getOutputStream().write(content);
    response.getOutputStream().flush();

THIS CODE WORK FINE!!!

Bye
 
 

Amit wrote:

[EMAIL PROTECTED]">
I am trying to generate PDFs using FOP-0.20.1. The input files are xml
and xsl files
I am using JRun3.0 with java1.2.2

Here is the error I get

WARNING: Unknown formatting object ^root

Anybody any ideas?




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Reply via email to