This should be possible and it has been asked before, but in my opinion, it's a bad idea: - You hardcode your layout in Java code which makes the whole thing hard to maintain and requires FO knowledge as well as Java knowledge. - You have to rewrite the whole transformation functionality in Java which could much more easily be written in XSLT. - Using XSLT, you can separate the layout from the processing which makes the whole things much easier to maintain. Cleaner application design, too. - You have to write new Java code for each new layout but you can just exachange the XSLT if you do the FO generation there. No need to redeploy the whole application. - I'm sure you wouldn't get a significant speed improvement if any. - In the end, I don't find a single point that would speak for the approach you envision (which reminds me a lot of the way it was done in the 1980s).
Jeremias Maerki On 21.11.2007 20:57:36 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? > > Thanks > > Linda --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
