[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    Re: create FONode objects directly and generate PDF file
From:       Manuel Mall <manuel () apache ! org>
Date:       2007-11-22 7:31:26
Message-ID: 200711221631.27050.manuel () apache ! org
[Download RAW message or body]

On Thursday 22 November 2007 04:57, Daling Xu wrote:
> Hi,
>
> I fully understand the process of from Java Obj -- > xml --> Fo file
> --> PDF and already made it work in my application.
>
> But is it possible directly create FONode objects, e.g. Flow, Table
> in my java code and then call a FOP api (maybe a Renderer or
> something) to generate a PDF file from the root FONode object?
>
> I am thinking this way because my data are in java object, then write
> a method to generate XML and create a XSLT file, all these steps
> could bring in complication and bug, why not directly generate the FO
> objects and generate the PDF, anyway I know which object in my data
> should generate what kind of things in my PDF.
>
> Anybody get similar experience?
>
Both Jeremias and Andreas pointed out to you the pitfalls in generating 
FONode objects directly. However, there is another approach which is a 
bit 'in between' which may suit you.

You can use the standard DOM API (org.w3c.dom package in the standard 
Java API) to build up a DOM representation of your XSL-FO document in 
memory and give that to FOP as FOP accepts a DOMSource as input. This 
avoids any intermediate serialized XML representation and also skips 
the XSL transformation step. I don't want to pass judgement here if 
that is a good approach or not but I know from experience it can be 
made to work.

> Thanks
>
> Linda
>

Manuel

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic