Improve support for PDF/A and PDF/UA #664
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This is a PR to improve support for PDF/A and PDF/UA with these modifications:
PdfBoxRenderer.addPdfUaXMPSchema()
andPdfBoxRenderer.addPdfASchema()
because both are setting the XMP metadata. allowing to generate a PDF that is both A and UA. It also levels out the behavior of the slow and fast modes;PdfRendererBuilder.usePdfAConformance()
now sets the PDF version because a conformance level is linked to a specific PDF version.I've been unable to properly generate a valid XMP string (edit: because of a bad transformer), so I've used a quick hack:
The two issues are:
xml:
prefix fixes the issue.In the PDF Extension, when adding the UA part (pdfuaid:part
), using the qualified call doesn't prevent the global prefix (pdfaExtension
) to be added.I don't know if it comes from the XmpSerializer (XmpBox) or the models (PdfBox), but it might weel be an issue in their side.
The generated PDFs (PDF/A with or without PDF/UA) have successfuly been tested against several validators:
The following changes could also be brought to the wiki page 'PDF A Standards Compliance':
builder.usePdfVersion(float)
should be removed, as the PDF version is now set by the method callbuilder.usePdfAConformance(conform)
. (There also was a typo, it should have been 1.7f, not 1.5f).Thanks,
Quentin