Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic support for PDF/A-2 and PDF/A-3 #1250

Open
hvbargen opened this issue Dec 22, 2024 · 4 comments
Open

Basic support for PDF/A-2 and PDF/A-3 #1250

hvbargen opened this issue Dec 22, 2024 · 4 comments

Comments

@hvbargen
Copy link

Is your feature request related to a problem? Please describe.
PDF/A-3 is needed for ZUGFeRD (Factur-X) electronic invoices.
Besides, VeraPDF complains about PDF files generated with OpenPDF about CIDSet when I try to generate PDF/UA-1 (tagging works BTW).

Describe the solution you'd like
Constants in PDFWriter.java for PDF/A-2a, -2b, -2u and PDF/A-3a, -3b, 3u.
Similar to the existing constants for PDF/A-1 and with corresponding code adaptions where the existing PDF/A-1 constants are used
(PdfXConformance.java, XmpWriter.java, PdfXConformanceImp, TrueTypeFontUnicode.java).

Describe alternatives you've considered
I don't think there any alternative solutions, except maybe post-processing the PDF with Apache PDFBox ;-).

Your real name
Henning von Bargen

Additional context
I'm working on adding PDF/UA support to Eclipse BIRT.

@andreasrosdal
Copy link
Contributor

Pull requests welcome. Thank you for reporting.

@hvbargen
Copy link
Author

hvbargen commented Jan 4, 2025

Hmm, I don't know what exactly is needed.

But let me share the issues I found when I was trying to create documents which conform to PDF/UA-1 and PDF/A-3a at the same time - finally, with success, see my work on PDF/UA support for Eclipse BIRT.

First of all, there are now constant or whatever to declare conformance with newer PDF/A versions.
There are int constants for PDF/A-1a and PDF/A-2b, but not for the newer versions.

For my own work, I just added additional constants in one of my files, see file PDFPageDevice.java and look for the comment
// FIXME THis is a workaround for the fact that OpenPDF does not support PDF/A-2.

Note: I did not a add a constant for PDF/A-4e, because I think I'm not going to support creating this with BIRT.

Next, it was surprisingly difficult to create a PDF file which conforms to PDF/A and PDF/UA at the same time.
That's not OpenPDF's fault, of course - it's the PDF/A specification which makes this so difficult My solution was to create suche a PDF with LibreOffice Writer and look at the XMP metadata. In my code I added a private class PDFAExtensionSchema which generates the XML directly in its toString() method, suitable for being called with addRdfDescription if the document shall be PDF/A and PDF/UA at the same time.

I think a similar utility method would be a good addition for OpenPDF.

The XmpWriter is not directly usable for my use case, because it will only write the PDFA1Schema (well, of course) if PDF/A-1 is specified. However, the schema can be used (despite its name) also for PDF/A-2, 3, or 4, if one calls addPart("2") and addConformance("A") or whatever after the construction.

@speckyspooky
Copy link

+1 to add additional support of PDF/A-version through OpenPDF.
This would increase the common usability of OpenPDF for PDF/A
and reduce the implementation efforts to realize the generation of different PDF/A-versions.

@p3rh2n
Copy link

p3rh2n commented Jan 23, 2025

+1 to add additional support of PDF/A-version through OpenPDF.

PDF/A-n-compliant documents are increasingly required in the specifications of the public digital infrastructure, see ZUGFeRD, ePA4ALL,... for Germany.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants