• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Apache FOP and iText

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
M Turner
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks very much for sharing your insight into this matter!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic