Repository navigation
Validate PDF/A and PDF/UA output with veraPDF, and fix PDF/A-2 and PDF/A-3 - #1807
Merged
andreasrosdalw merged 2 commits intoDec 2, 2026
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 30 |
| Duplication | 2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
VeraPdfConformanceTest creates documents with text in an embedded font, a JPEG image, a table, a link, transparency, an image with an alpha channel and a layer, and validates them with veraPDF as PDF/A-1b, PDF/A-2b, PDF/A-2u, PDF/A-3b, PDF/A-3u and PDF/UA-1. The tests found that PDF/A-2 and PDF/A-3 documents could not be created with features these standards allow: - PdfXConformanceImp rejected transparency, images with an /SMask and layers for every PDF/A part. Only PDF/A-1, PDF/X-1a and PDF/X-3 forbid them. - TrueTypeFontUnicode wrote a CIDSet with only the used CIDs. PDF/A-2 and PDF/A-3 (6.2.11.4.2) require all CIDs of the font program, and the CIDSet is optional there, so it is left out. - The default optional content configuration had no /Name and could have an /AS entry, which PDF/A-2 and PDF/A-3 (6.9) do not allow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add the changes of LibrePDF#1801, LibrePDF#1803, LibrePDF#1804, LibrePDF#1805 and LibrePDF#1806, which were merged without a changelog entry, the pull request number of LibrePDF#1802 and LibrePDF#1807, and the contributors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
andreasrosdal
force-pushed
the
verapdf-validation-tests
branch
from
December 2, 2026 21:29
fe95e33 to
99a373c
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Description of the new Feature/Bugfix
Adds veraPDF validation tests for documents created by OpenPDF, and fixes the PDF/A-2 and PDF/A-3 problems that the tests found.
New tests:
VeraPdfConformanceTestEach test creates a document and validates it with veraPDF (
validation-model, which is already a test dependency). On failure it prints the rule numbers and messages of the violations.pdfA1bWithTextImageTableAndLinkPdfPTable, link, sRGB output intent, XMPpdfA2b…,pdfA2u…,pdfA3b…,pdfA3u…WithTextImageTableLinkAndTransparencypdfA2b/pdfA3bWithImageWithAlphaChannelAndLayer/SMask), a layer with print usagepdfA1bStillRejectsTransparency,pdfA1bStillRejectsImageWithAlphaChannelpdfUa1WithTaggedHeadingAndParagraphDocument/H1/P,/Lang,DisplayDocTitle,pdfuaid:partFixes for PDF/A-2 and PDF/A-3
Before this PR, all PDF/A-2 and PDF/A-3 tests failed:
PdfXConformanceImpapplied the PDF/X-1a and PDF/A-1 rules to every PDF/A part. Setting a fill opacity threwTransparency is not allowed: /ca = 0.5, adding a PNG with an alpha channel threwThe /SMask key is not allowed in images, and adding a layer threwLayers are not allowed. PDF/A-2 and PDF/A-3 allow all three. They are still rejected for PDF/A-1, PDF/X-1a and PDF/X-3.CIDSet(rule 6.2.11.4.2). For subset Identity-H fonts OpenPDF wrote aCIDSetwith only the used CIDs. PDF/A-2 and PDF/A-3 require aCIDSetto cover all CIDs in the font program. TheCIDSetis optional there, so it is no longer written for PDF/A-2 and PDF/A-3. PDF/A-1, which requires it, and documents that are not PDF/A do not change./Dgets a/Name(Default), which PDF/A-2 and PDF/A-3 require. For PDF/A, the/ASauto-state array is no longer written, because PDF/A does not allow it.Everything else about non-PDF/A documents is unchanged, apart from the new
/Nameentry in the/Ddictionary of documents with layers, which is valid in every PDF version.Unit-Tests for the new Feature/Bugfix
See the table above.
./mvnw -B installpasses locally on Java 25 for all modules, and./mvnw checkstyle:checkreports nothing on the changed files. The changelog for 4.0.1 is updated.Changelog of 4.0.1
A second commit completes
changelogs/4.0.1.md: it adds the changes of #1801, #1803, #1804, #1805 and #1806, which were merged without a changelog entry, the pull request numbers, and the contributors of the release.🤖 Generated with Claude Code