Article:
  Dynamically Creating PDFs in a Web Application
Subject:   FOP
Date:   2003-06-19 09:45:53
From:   gadders
How does IText compare to FOP? What are the pros and cons of each? We've used FOP before and found it pretty good for what we wanted.
Full Threads Oldest First

Showing messages 1 through 5 of 5.

  • FOP
    2003-06-22 19:20:46  anonymous2 [View]

    The comparison is easy:

    - Creating PDF entirely from scratch on every page view: use FOP.

    - Merging existing PDFs and/or changing existing PDF files: use iText or similar tools like PDFPrepTool.

    It's easy to take XML data and put it on a PDF using iText, it's also easy to convert non-XML data to XML to use FOP. It's more a matter of how much you want to code versus the strengths of the tool.
  • FOP
    2003-06-20 02:29:33  anonymous2 [View]

    There is some experimental XML2PDF functionality in iText, but if you need to generate PDF from XML, I guess you're better of with FOP.
    On the FOP-site, they recommend iText as post-processor to merge, encrypt,... FOP generated PDF files.
    If you are generating PDF from code, you should use iText instead of FOP because it's much easier and you need less code. For instance: you have a database table you access with JDBC and you want to put everything in a PDF, RTF or HTML report simultaneously. (I don't think FOP generates RTF, but I'm not 100% sure about this.)
    Also if you have written code for a java.awt.Graphic2D object already, you can reuse that code to paint directly to a PDF page.

    These are only some of the differences...
    • FOP
      2004-02-04 06:32:50  kercadio [View]

      Another difference is the duration of generating the PDF document. iText is much faster to generate very long documents.

      iText has a lot of functionalities using directly the Java libraries, but less ones using the Cocoon iText Serializer. You can however use the Serializer with Cocoon, like FOP: FOP uses XSL:FO, iText uses its own format (iText-xml)
  • coordinate based tools
    2003-06-19 20:58:34  anonymous2 [View]

    I haven't used iText (I'm a FOP fan myself), but I'm familiar with some of the pros and cons of coordinate based tools like iText - the pro is that it is nice when you have to write to a pre-defined pdf, but the disadvantage is if the format changes, it throws off all your coordinates. This isn't an issue with FOP, however while you can build pretty much anything with FOP (images, etc) and the formattingis very powerful, it definitely requires some practice.
    • coordinate based tools
      2003-06-20 02:19:38  anonymous2 [View]

      Hmm, you are talking about 'Advanced iText' only and ignoring the 'Simple iText' functionality. iText allows you to work with a com.lowagie.text.Document-object and add high-level objects such as Paragraph, Phrase, Chunk,...
      In that case, you needn't know anything about the coordinate system. You just keep on adding objects and if the end of a page is reached, a new page is automatically started (as one would expect).