JasperReports java library: Can it handle PDF 2.0

2019-08-26 04:38发布

问题:

I've been using JasperReports in my java projects for a while, but now i'm facing a problem. A customer requires the generation of PDF files compliant with the ISO 32000-2:2017 standard. JasperReports uses iText for pdf rendering, and I know that the latest version of iText can handle PDF 2.0, but i've found out that JasperReports is currently using an older version of iText because of IP issues with the newer releases. Does it mean that i cannot create PDF2.0-compatible files with this library? Do you have any alternative?

Thanks in advance

回答1:

No, JasperReports doesn't support PDF 2.0. JasperReports can't use iText 7.1.x because (1.) its open source license isn't compatible with iText's open source license, and (2.) as far as I know, TIBCO isn't a paying customer of iText Group.

As an alternative, you might look into iText DITO. DITO stands for Design Interactive Templates Online. It's a new product from iText Group that will be released soon, but if you contact iText, you might get early access.

The goal is to allow people to create two types of templates using a WYSIWYG tool.

  • The first type consists of a template for input. When deployed in combination with the DITO SDK, it produces HTML 5 forms that can be used to enter data manually.
  • The second type consists of a template for output. When deployed in combination with the DITO SDK, it produces PDF documents (PDF 2.0, PDF/A, PDF/UA,...).

The template itself is a .dito file. That file is a ZIP file containing HTML, CSS, resources such as images, and information about data binding between the variable fields in your template and your actual data (e.g. data stored in a JSON file).

The DITO SDK takes the HTML template, populates it with data based on the data binding, and then uses iText 7 and the pdfHTML add-on to create the PDF.

Currently, I don't know of any other vendor that has a templating solution that supports PDF 2.0.