OpenPDF icon indicating copy to clipboard operation
OpenPDF copied to clipboard

What PDF and PDF/A versions are supported?

Open katjas opened this issue 4 years ago • 5 comments

Hi there

we are evaluating which PDF creating library we want to use in our company (we are currently using an iText 2.1.7 and would like to replace it). The main criteria are to be able to produce PDFs in version 1.7 respectively PDF/A-2 at least. I the OpenPDF library able to produce such files? I have not found this information in the available documentation unfortunately.

Thanks in advance and kind regards Katja Sondermann

katjas avatar Jun 04 '21 12:06 katjas

As from the source code, there seems to be support for PDF 1.7, and PDF/A1A and PDF/A1B https://github.com/LibrePDF/OpenPDF/blob/12ecb0f21b3766f19f46a5ff902e0008b1b883dd/openpdf/src/main/java/com/lowagie/text/pdf/PdfWriter.java#L1346 https://github.com/LibrePDF/OpenPDF/blob/12ecb0f21b3766f19f46a5ff902e0008b1b883dd/openpdf/src/main/java/com/lowagie/text/pdf/PdfWriter.java#L1737

Please be aware that OpenPDF is a maintained fork of iText 2.1.7, with some Java and dependencies updates, but there is no relation to itextpdf.com.

asturio avatar Jun 07 '21 11:06 asturio

I recommend that you update from iText to OpenPDF.

What is needed for OpenPDF to support PDF/A-2?

https://www.loc.gov/preservation/digital/formats/fdd/fdd000319.shtml

andreasrosdal avatar Feb 18 '22 05:02 andreasrosdal

I'm not really an expert, but AFAIK in order to create a document that claims to be PDF/A, basically the following steps are necessary:

  • Add an output intent with a color profile
  • Add XMP metadata
  • All fonts must be included (even the 14 "built-in" fonts).

Then one can use a PDF/A validator tool and (as long as the PDF doesn't contain more exotic features) the validator should accept the PDF.

In one of our commercial products, we are generating PDFs with BIRT, which used iText 2.1.7 internally in older releases and now uses OpenPDF and we post-process these PDFs later as I described above to make them PDF/A-3 compliant (with conformance level B). For this conversion, we are using a little custom code and Apache PDFBox, but of course it would be nice if OpenPDF supported this. This would allow Eclipse BIRT to generate PDF/A directly.

Based on this, one can also create ZUGFeRD aka Factur-X invoices. This is a standard based on PDF/A, where a single PDF file contains a human-readable, printable invoice and a machine-readable XML representation of the invoice. Basically, one needs a PDF file and the corresponding XML file and combines this to one ZUGFeRD file (which is PDF/A-3 compliant). However, the XML has to be created in addition to the PDF - it cannot be derived from PDF automatically, so this cannoit not be done with OpenPDF alone.

hvbtup avatar Feb 01 '23 09:02 hvbtup

@hvbtup may I ask you for some hints about PDF post-processing you've used? How it can be implemented?

luzhanov avatar May 16 '23 14:05 luzhanov

Sorry, I can't give you more hints than the pointers I already gave, because that code itself is not open source. But if you have more specific questions, please feel free to ask.

Unfortunately I will not be able to answer any questions before mid June.

hvbtup avatar May 16 '23 15:05 hvbtup