Skip to content

Conformance: a PDF/A or PDF/UA claim is stamped on a document the library's own preflight rejects #474

Open

Description

@Tim81

Document.Save writes the pdfaid XMP identification when Conformance is set, without checking
that the fonts in use are embedded. The same solution's PdfPreflight then rejects the bytes it
just wrote. So the library produces a file that asserts a profile it does not meet, and the
assertion is what a validator, an archive ingest or a compliance reviewer reads first.

Measured on 4788c4b: a 400x400pt page, one paragraph in unembedded Standard14.Helvetica,
Tagged set, a CMYK output intent, and Conformance set to each PDF/A level in turn. Each file
carries pdfaid, PdfPreflight.DetectClaimedProfiles returns the claimed profile, and
PdfPreflight.Validate returns IsCompliant false:

Conformance Bytes Claims Compliant
PdfA2b 2632 PdfA2B false
PdfA2u 2632 PdfA2U false
PdfA2a 2632 PdfA2A false

Both errors, identical for all three:

ISO19005-2:6.2.11.4.1-font-embedding | The font /Helvetica is not embedded;
    PDF/A requires every font to embed its font program.
ISO19005-2:6.2.4.3-2-device-rgb | The document paints DeviceRGB but has neither a /DefaultRGB
    colour space nor a PDF/A output intent (GTS_PDFA1) with an RGB DestOutputProfile.

The second is an artefact of pairing a CMYK intent with RGB paint in this reproduction, so the
font-embedding error is the one that matters: a Standard 14 font can never satisfy PDF/A, and it is
the library's own default. PDF/UA-1 fails the same way on ISO14289-1:7.21.4.1-1.

The fix must not be a hard refusal at Save. VellumPdfShowcase, which reported this, relies on
being able to demonstrate a failing preflight verdict, and a throw at Save would remove that.
The right shape is the notify-and-continue channel this library already has for text-encoding
warnings and, since #469, for band truncation: Save reports that the claim cannot be met and
names the font and UseTrueTypeFont, while still writing the file. Omitting the identification
instead would also be defensible, but it changes bytes for every caller who is currently getting a
false claim, so it wants a maintainer decision rather than a default.

Reported by VellumPdfShowcase, which found it against 2.3.1; the figures above are my own
reproduction against main, and the font rule id differs from theirs (6.3.4), which is the shipped
package against main rather than a disagreement about the defect.

Activity

  1. added this to the v2.3.3 — Hardening milestone on Sep 10, 2026
  2. Tim81 commented on Sep 12, 2026

    @Tim81
    OwnerAuthor

    Two more triggers of the same defect, neither caught by the font fix

    This issue is framed on unembedded fonts. VellumPdfShowcase found two further inputs that stamp a
    profile claim the document does not meet, and neither would be closed by whatever fixes the font
    case
    . Both are checkable from state the library already holds at save time.

    Level A is claimed on an untagged document

    Conformance = PdfA2a;  Tagged = false;  a valid output intent;  one heading
    -> saves 3,474 bytes with the PDF/A-2a claim stamped
    

    The trigger is one boolean the library reads anyway. ISO 19005-2 clause 6.8 makes tagging a
    requirement of level A rather than an option; that clause is not held here, so the citation is the
    showcase's and wants checking against the text before it goes into a message.

    PDF/UA-1 is claimed over a figure with no alternative text

    Conformance = PdfUA1;  Tagged = true;  a PieChart with neither AltText nor Decorative
    -> saves 3,219 bytes with the PDF/UA-1 claim stamped
    

    This one is verified here against the held standard. ISO 14289-1:2014 clause 7.3, Graphics:

    Graphics objects, other than text objects, shall be tagged with a Figure tag [...] Figure tags
    shall include an alternative representation or replacement text that represents the contents
    marked with the Figure tag as noted in ISO 32000-1:2008, 14.7.2, Table 323.

    Both are shall. PieChart and LayoutImage already carry AltText, and the renderer knows
    whether it was supplied, so the claim is checkable at the point it is stamped.

    The same clause settles the Decorative plus AltText question

    The showcase reports these being accepted together with no stated precedence and asks which should
    win. The standard does not leave it open. Clause 7.3 continues:

    If any of the following exceptions are true, then the graphic shall be tagged as an artifact:
    — the graphic does not represent meaningful content [...]

    So a graphic is one thing or the other. Decorative means artifact, and an artifact is outside the
    structure tree and carries no alternative text by definition. A Figure is in the tree and shall have
    alternative text. Setting both is not an ordering problem to be resolved by precedence; it is a
    contradiction the standard does not admit, and refusing the combination is the answer that matches
    the text.

    Scope this adds

    • Check Tagged before stamping a level A claim.
    • Check that every Figure-tagged element carries AltText, or is marked Decorative, before
      stamping a PDF/UA-1 claim.
    • Refuse Decorative and AltText together, citing 7.3.
    • Verify the ISO 19005-2 6.8 citation against the text before it appears in a message. It is
      readable on NEN Connect even though the file is not held.

    NOTE the reporting shape is already decided on this issue and does not change: report through the
    notify-and-continue channel and still write the file, because the showcase relies on being able to
    demonstrate a failing preflight verdict. A refusal at Save would remove that.

    One correction to the report

    The showcase relates its all-header-table item to #516. That is #488, "a table whose every row is a
    header refuses to render on a page with room to spare". #516 is the unrelated case of a single row
    taller than a page. Their observation still adds something to #488: with two hundred header rows the
    table is not merely unpaginated but unsatisfiable, since header rows repeat on every page, so no
    page size makes progress and the message's advice to reduce content or enlarge the page cannot help.

  3. Tim81 commented on Sep 20, 2026

    @Tim81
    OwnerAuthor

    Moved to v3.0, next to #482 and #484, by the maintainer's decision on 2026-09-20. The reporting shape this issue asks for (a notify-and-continue channel on PdfDocument) is a new public warning API, which does not belong in a hardening patch.

    What a patch can do is split out as #558: the documentation slice, no API and no byte change.

    Read from origin/main at cbbf7d5 while triaging. Nothing was run, and the figures in this issue and its comment were measured on 2.3.1 and 4788c4b, so treat the two extra triggers below as unconfirmed against v2.3.3:

    • Level A on an untagged document. PdfDocument.Tagged reads _tagged || Conformance == PdfConformance.PdfA2a || Conformance == PdfConformance.PdfUA1 (PdfDocument.cs:186), and Document.Tagged documents that it reads true for those levels "whatever you set". By the source, Tagged = false cannot produce an untagged level A file. The 3,474 bytes repro was not re-run.
    • PDF/UA-1 over a figure with no alt text. PieChartRenderer.cs:251 writes AltText = _chart.AltText ?? BuildAltText(total) and LayoutImageRenderer.cs:164 writes AltText = _img.AltText ?? "Figure", so a figure without AltText still carries a non-empty /Alt today. Whether a placeholder satisfies ISO 14289-1 7.3's "alternative representation or replacement text" is a separate question this issue does not settle.
    • Decorative together with AltText. PieChart.cs:250 and :254 document both as "Ignored when Decorative is true", so precedence is stated and, per the renderers, implemented. Refusing the pair is a tightening of input that renders valid output today, which is the category Refuse the input 2.3.x only reports: the contract changes a patch cannot make #484 defers to 3.0.

    Still open here: the warning channel, and the choice between reporting and omitting the identification (which changes bytes for every caller who gets a false claim today).

  4. Tim81 commented on Nov 18, 2026

    @Tim81
    OwnerAuthor

    Scope for v2.4, so the milestone and the decisions on #484 and #496 stay consistent.

    This issue says "The fix must not be a hard refusal at Save", and #484 (v3.0) is where refusals of input that
    renders today go. So v2.4 ships reporting and an opt-in strict mode, and refusal by default stays in 3.0:

    Measured in the 2026-11-16 handbook research on VellumPdf 2.3.3: with Conformance = PdfUA1 and no Info.Title,
    no Language, or a standard-14 font, Save succeeded and wrote pdfuaid:part 1; both validators then failed
    7.1 (title), 7.2 (language) and 7.21.4.1 (fonts).

    What stays open here for 3.0: refusing by default, and the XMP-omission alternative this issue describes (it
    changes bytes for every caller that holds a false claim today).

  5. Tim81 commented on Nov 27, 2026

    @Tim81
    OwnerAuthor

    The v2.4 slice is #748: under a claim, Layout reports the measured cases (PDF/UA-1 without a title or a language) as Errors so strict mode refuses; the default refusal stays here for 3.0.

  6. Tim81 commented on Nov 29, 2026

    @Tim81
    OwnerAuthor

    The ISO audit (docs/conformance-v2.4.md) has skipped tests that wait on this issue; the fix removes their skip and makes them pass.

    • Iso19005_2_6_2_11_8_ACharacterTheFontLacksIsRefusedUnderAClaim (group G2)
    • Iso19005_2_6_2_11_4_1_AStandard14FontIsEmbeddedOrRefusedUnderAClaim (group G2)
    • Iso14289_1_7_1_PdfUA1RefusesOrCarriesATitleAndALanguage (group G5)
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions