Question

Using iText api can I achieve the following?

We have a requirement of generating pdf documents with-

  1. Header (static data) repeated in all pages. Same data should be filled or repeated in all pages.
  2. Product Details section (grows data dynamically). This section is kind of table, but values are formed from multiple hibernate entity fields.
  3. Footer repeats in all pages (hard-coded footer)

If this is achievable with iText api, we are planning to buy commercial licence.

Was it helpful?

Solution

With the core iText, you can fill out an XFA form by injecting XML. The functionality you describe requires that you create a dynamic XFA form first (e.g. using Adobe LiveCycle Designer). The result will be a filled out XFA form (XML wrapped in PDF).

If you want to flatten that dynamic PDF (for instance because you want to turn it into a PDF/A, PDF/UA, ordinary PDF document), you need XFA Worker. This will convert the XML stream to PDF syntax (no more XML inside the PDF, except for the XMP data, or, if you need to comply with the ZUGFeRD standard: an XML attachment).

iText is licensed under the AGPL, that means that you can use it for free under specific conditions. For instance: you may need to distribute all your own source code for free. XFA Worker is a closed source product, written on top of iText. You can download a trial version that will add "trial version" on top of all your flattened documents.

If you go for XFA, then your only options are Adobe LiveCycle ES or XFA Worker. I don't know of any other software that supports XFA flattening.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top