Skip to content

Fix PDF/UA fonts getting the PDF/A-1 CIDSet - #1879

Merged
blikblum merged 1 commit into
foliojs:masterfrom
PeterKalmstrom:fix/pdfua-cidset
Nov 26, 2026
Merged

blikblum merged 1 commit into
foliojs:masterfrom
PeterKalmstrom:fix/pdfua-cidset

Conversation

@PeterKalmstrom

Copy link
Copy Markdown
Contributor

Fixes #1878.

PDF/UA sets document.subset = 1, the same value as PDF/A-1, so EmbeddedFont wrote PDF/A-1's partial /CIDSet into PDF/UA files, and veraPDF failed them under UA-1 rule 7.21.4.2. The CIDSet is now written only when a PDF/A conformance level is also set (subset_conformance), which only initPDFA does.

  • lib/font/embedded.js: the CIDSet condition is narrowed to PDF/A-1.
  • tests/unit/pdfua.spec.js: a new test, font data contains no CIDSet.
  • CHANGELOG.md: an entry for the fix.

Checked: the PDF/UA and PDF/A-1/2/3 unit specs pass (23 tests), and the existing PDF/A-1 test font data contains CIDSet still passes. A PDF/UA file with the change passes verapdf --flavour ua1.

🤖 Generated with Claude Code

PDF/UA sets document.subset to 1 (its part number), the same value as
PDF/A-1, so embedded fonts of a PDF/UA file got a CIDSet listing only the
subset's glyphs. veraPDF rejects that under PDF/UA-1 (7.21.4.2). Only
PDF/A-1, which also sets a conformance level, now writes CIDSet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@blikblum
blikblum merged commit 349acef into foliojs:master Nov 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF/UA documents get the PDF/A-1 /CIDSet and fail PDF/UA-1 validation

2 participants