The example that I give is only to explain
that you can perform the PDF in two distinc phase
1) perform a trasformation
2) use driver
You can use the "tranform method"
with input like Dynamic xml (Dom Document) or urlXML
and getting out a fo (Dom Document) or Writer object
YOU HAVE A LOT OF TRANSFORM TO USE!!!!!!
YOU HAVE TO SEE THE APIDOC FOR THE
For example in my project I use
xalan transform and with some
conversion I use the Fop driver
and my XML is dynamic.
WITH Transformer XALAN:
StringWriter SstringWriter = new StringWriter();
/* this is the fo file */
StreamResult SstreamResult = new StreamResult(SstringWriter);
/* convert the fo file in a right format for driver
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
SResult = SstringWriter.toString();
ByteArrayInputStream str = new ByteArrayInputStream(SResult.getBytes());
Driver driver = new Driver(new InputSource(str), outPDF);
Is this performance????? I think yes!!
[EMAIL PROTECTED]"> 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
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();
InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
XMLReader parser = inputHandler.getParser();
I have solved the problem using 2 phase:
1) generate the transformation using XSLTrasform, Xalan1Transform etc... (you can choose)
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);
Driver driver = new Driver(new InputSource(file), out);
byte content = out.toByteArray();
THIS CODE WORK FINE!!!
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]