wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes Apache FOP and iText Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Apache FOP and iText" Watch "Apache FOP and iText" New topic
Author

Apache FOP and iText

M Turner
Greenhorn

Joined: Dec 16, 2009
Posts: 25
I have a requirement to present a PDF on demand in a web application injecting user specific data. I'm looking at both Apache FOP and iText for the solution.

It seems to me that iText is a better fit for what we're doing. However, it would be ideal if we could separate the styling of the PDF from the code that generates the document. I don't see evidence of being able to separate the style from the document generation code in the simple iText examples that I've seen. Although I gather that this is the way it's done in Apache FOP.

Should I be considering using both rather than one or the other? From the iText mailing lists it does seem to me that people use both libraries together. Can I generate a document with all the data in iText and then apply the styles using FOP? It seems like FOP wants an XML document to work on.

How have people solved this problem? Both libraries have been around for a while so I assume people have, but I don't see much comment on this fact online.

TIA

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
Your perception is correct that using iText your style information would be part of the Java code (obviously, you could factor style info out into properties that get consulted when the PDF is created, but basically the Java code is where that information is specified).

FOP and iText are often mentioned together because FOP uses iText underneath; but that's completely transparent to FOP users.

FOP makes sense if your data is highly regular (lots of tables), or if you have XML data to begin with. Plus, maintaining XSL-FO stylesheets is a skill one needs to acquire, while iText's API approach should be familiar to every Java developer.


Ping & DNS - updated with new look and Ping home screen widget
M Turner
Greenhorn

Joined: Dec 16, 2009
Posts: 25
Thanks very much for sharing your insight into this matter!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache FOP and iText
 
Similar Threads
XML reporting and look query
.jsp file to .pdf file
Apache FOP and iText
PDF creation, disallow printing without setting permissions password
FOP Vs IText