Skip to content

Conformance: PDF/A-4 (ISO 19005-4) — stop downgrading conformance output to %PDF-1.7 #222

Open

Description

@Tim81

VellumPdf writes %PDF-2.0 by default (PdfDocument.cs:600-604, :996, :1663) — but the
moment a caller asks for a conformance profile, it silently downgrades to %PDF-1.7, because the only
profiles the library implements (PDF/A-2, PDF/UA-1) are defined against ISO 32000-1.

So today there is no way to produce an archival document that is also PDF 2.0. The 2.0 output path
is the unvalidated one, and the validated path is not 2.0. PDF/A-4 (ISO 19005-4:2020) is the profile
that closes that gap
— it is defined against ISO 32000-2 and requires a %PDF-2.n header.

PDF/A-4 and 19005-4 still do not appear in the tree. PDF/UA-2 and 14289-2 now do: #275-#280 and
#246 track the rule set, and ISO 14289-2 is held on disk. This is the tracker for PDF/A-4.

The oracle is already available

veraPDF 1.30.2 — the pinned version — ships flavours 4, 4f, 4e and ua2. Confirmed from the
CLI's own --flavour enumeration:

Possible Values: [0, 1a, 1b, 2a, 2b, 2u, 3a, 3b, 3u, 4, 4f, 4e, ua1, ua2, wt1r, wt1a]

So both paths of every rule can be cross-validated in CI exactly as PDF/A-2 and PDF/UA-1 are, with no
oracle change. The 4 profile carries 103 rules.

Conformance levels

PDF/A-4 drops the A/B/U split entirely — there is no separate accessible or Unicode level, because
Unicode mapping is required of every conforming file and tagging is deferred to PDF/UA. Instead:

  • PdfA4 — the base level
  • PdfA4F — permits embedded files that are not themselves PDF/A
  • PdfA4E — engineering, adds 3D/RichMedia

Scope this issue to PdfA4 and PdfA4F. PdfA4E needs PRC/U3D support the library does not have
and should not acquire for this.

What we are actually missing — mapped rule by rule

Verified against the writer, not assumed.

Rule Requirement Where we stand
6.1.2/1 header is %PDF-2.n The default path already does this. The conformance path must stop forcing 1.7 — PdfDocument.cs:600-604, :996, :1663 all branch on Conformance == PdfConformance.None, which becomes wrong once a 2.0 profile exists.
6.1.3/5 if /Info is present it may contain only /ModDate Blocking gap. PdfDocumentInfo carries Title, Author, Subject, Keywords, Creator, Producer and is always written (PdfDocument.cs:786, :1170). A PDF/A-4 file must move all of it to XMP.
6.1.3/4 /Info present ⇒ catalog needs /PieceInfo /PieceInfo appears nowhere in the tree.
6.7.3/2 pdfaid:part = 4 XmpMetadataWriter.cs:127-129 writes part; needs the new value.
6.7.3/3 pdfaid:conformance must be absent for base PDF/A-4 Gap. XmpMetadataWriter.cs:130-132 always emits <pdfaid:conformance>. It has to become conditional.
6.7.3/5 pdfaid:rev = "2020" Gap. No pdfaid:rev is emitted at all.
6.9/4 embedded files need /AFRelationship /AFRelationship appears nowhere in the tree. Only needed for PdfA4F.
6.1.6.2/1 LZWDecode prohibited Satisfied by construction — LZW is decode-only in this library; there is no LZW encoder on the write path.
6.1.3/2 /Encrypt prohibited in the trailer Already expressible — conformance output is written unencrypted.
6.2.9/2 transparency allowed, given a blending colour space or output intent Output intents are already implemented. PDF/A-4 is more permissive here than PDF/A-2, so this is a relaxation rather than work.
6.2.10.7/1 ToUnicode values may not be U+0000, U+FEFF, U+FFFE The Conformance rules for this exist for PDF/A-2; they generalise.
6.1.11/1 permissions dictionary limited to /UR3 and /DocMDP Signing already writes /DocMDP; needs a check, not new capability.

#199 becomes load-bearing, not cosmetic

#199 (Info.Keywords is never mirrored into the XMP packet) is currently filed as a small
metadata defect. Under 6.1.3/5 it is a prerequisite: PDF/A-4 permits nothing but /ModDate in
/Info, so XMP becomes the only place document metadata can live. Every PdfDocumentInfo property
needs an XMP counterpart before a PDF/A-4 file can carry them at all. Worth linking the two.

Why this rather than PDF/A-1 (#218)

Both are unimplemented profiles. The difference is direction: #218 adds a 2005 profile built on
PDF 1.4, needed only to unblock #140's recursive-validation case. This one matches what the library
already emits by default and is the standard actively recommended for new archival work. If only one
lands in v2.5, this is the one that changes what users can produce.

Advertising it

Do not claim PDF 2.0 support in the README, package descriptions or index.md until this validates
green.
The library emits a 2.0 header today, which is not the same as conformance — and the gaps
above are exactly the sort a reader would hit. The claim should be gated on the same evidence every
other conformance claim in this repo is: both paths of every rule cross-validated against veraPDF in
CI, no rule left Deferred, and the catalog honest about anything Partial. When that holds, update
the package table, docs/architecture.md, and the Conformance package description together.

Acceptance

  • PdfConformance.PdfA4 and PdfA4F added (public enum, additive, needs a PublicAPI.Unshipped.txt
    entry).
  • Conformance output writes %PDF-2.0 for these profiles.
  • ConformanceCatalog gains the PDF/A-4 clause inventory; ConformanceCatalogTests' exact-set
    assertion and Deferred == 0 still hold.
  • Both paths of every rule cross-validated against veraPDF flavour 4 (and 4f) in CI.
  • A round-trip test: a document written as PDF/A-4 validates green against the oracle.

Activity

  1. added
    area/conformance
    type/feature
    priority/P1
    needs-design
    on Aug 28, 2026
  2. Tim81 commented on Aug 28, 2026

    @Tim81
    OwnerAuthor

    Related: #223 adds an explicit PdfVersion on the writer. The two touch the same header branch (PdfDocument.cs:600-604, :996, :1663), and #223 depends on the decision this issue makes about how Conformance pins the version — a profile should set it, and an incompatible explicit value should throw rather than be silently overridden.

  3. Tim81 commented on Aug 28, 2026

    @Tim81
    OwnerAuthor

    Related: #225 proposes inventorying ISO 32000-2's 79 level-1 normative references from pdf-association/PDF2NormRefs (Apache-2.0, 1,173 documents) and gating the PDF 2.0 claim on that table rather than on the profile alone.

    Two things from that graph bear directly on this issue:

    • PRC (ISO 14739-1) and U3D (ECMA 363) are both level-1 references marked high parser complexity — which is the independent confirmation that scoping to PdfA4/PdfA4F and excluding 4e is the right call.
    • The inventory is a coverage map, not a conformance test. veraPDF's flavour-4 profile stays the operative rule set here.
  4. Tim81 commented on Aug 29, 2026

    @Tim81
    OwnerAuthor

    Corrections and a scope change, from the ISO 32000-2 research in the v2.6–v2.13 planning pass.

    1. The rule count is wrong: 103 → 109

    This issue says the 4 profile carries 103 rules. Extracted from the pinned oracle
    (PDFA-4.xml inside cli-1.30.2.jar, veraPDF 1.30.2), the actual counts are:

    Profile Rules
    PDF/A-4 (4) 109
    PDF/A-4F (4f) 109
    PDF/A-2B, for comparison 144
    PDF/A-1B 129

    Note 4 and 4f have the same count — the difference between them is rule content, not
    quantity, so 4F is a delta over 4 rather than a second rule set.

    2. PdfA4F moves out, to #246

    Rule 6.9/4 requires embedded files to carry /AFRelationship — and /AFRelationship has zero
    occurrences anywhere in this repository. So 4F cannot be cross-validated against output this library
    is able to produce until the attachment work lands.

    Keeping it here would either block v2.5 on the whole attachment milestone or ship a profile with no
    producible fixture. This issue is now scoped to PdfA4 only; #246 owns PdfA4F in
    v2.7 — Embedded files and associated files, after #243 (/AF and /AFRelationship).

    The acceptance criteria above should drop the flavour 4f cross-validation; #246 carries it.

    3. Corroboration for two claims already made here

    4. On the PDF 2.0 claim

    The note in this issue about not advertising PDF 2.0 support before this validates green still holds
    and is now backed by a broader inventory — see the rewritten #225.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/conformanceneeds-designpriority/P1type/feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions