Skip to content

Kernel: associated files — /AF and /AFRelationship (ISO 32000-2 §14.13) #243

Open

Description

@Tim81

ISO 32000-2 §14.13 introduced associated files — a machine-readable way to say what an embedded file
is to the object it hangs off
. /AFRelationship appears nowhere in this repository, and /AF
appears only in EmbeddedFileRule.cs, where the validator notes that a file specification reached
only through an /AF entry still counts.

Scope

An /AF array — of file specifications (A2) — permitted on the catalog, pages, annotations, form and
image XObjects, structure elements and /DPart dictionaries.

AN002 §3.2 is emphatic that the list is open: "The list of objects for which the AF entry may be
present is explicitly open in PDF 2.0 and an AF entry may be used anywhere in a PDF file." That is a
deliberate contrast with PDF/A-3, where the list is closed (ISO 19005-3 Table E.1 — which, AN002 notes,
predates /DPart and so lacks it). The API should not model a closed list.

/AFRelationship on the file specification, with the eight defined values:

Value Meaning
Source the editable original the PDF was produced from
Data machine-readable data behind the content — a diagram's dataset, a chart's numbers
Alternative a different rendering of the same information
Supplement supplementary material
EncryptedPayload the payload of an unencrypted wrapper document (7.6.7)
FormData —
Schema —
Unspecified —

Custom values are explicitly permitted where none fits. AN002 gives no gloss for FormData or
Schema; do not invent one.

For embedded associated files AN002 §3.1 adds two requirements beyond A2's baseline: the MIME type
in /Subtype is mandatory, and if the (recommended) /Params is present it shall carry the
latest modification date.

A specification conflict to record, not resolve silently

PDF/UA-2 §8.2.5.29.1 and WTPDF §8.2.5.29.1 both require /AFRelationship = Supplement for a
MathML representation attached to a Formula structure element. AN002 §4.2.2 suggests
Alternative for the same case. The ISO standards are normative and the application note is not,
so follow Supplement — but write the divergence down so nobody "fixes" it later.

Acceptance

  • /AF written on each of the six object types above, round-tripping through the reader.
  • Every /AFRelationship value exercised, plus a custom one.
  • A MathML-on-Formula fixture using Supplement, with the conflict noted in a comment citing both.
  • qpdf --check clean.

Relates to

  • A2 — the file specifications this references.
  • A5 — PDF/A-4F rule 6.9/4 requires /AFRelationship on embedded files.
  • v3.2 — attaching associated files to an existing document.

Plan labels used above, resolved: A2 #242 · A5 #246.

Activity

  1. Tim81 commented on Aug 29, 2026

    @Tim81
    OwnerAuthor

    A specification conflict to be aware of when implementing this, folded in from #363.

    When presentation MathML is attached to a Formula structure element as an associated file, the
    sources disagree on which /AFRelationship value to use:

    Source Value Force
    ISO 14289-2 (PDF/UA-2) §8.2.5.29.1 Supplement normative, stated as a shall
    WTPDF 1.0 §8.2.5.29.1 Supplement identical wording
    PDF 2.0 Application Note 002 §4.2.2 Alternative informative

    Use Supplement. The two ISO documents are normative; AN002 says of itself that it "provides
    interpretation of the existing specifications; it does not change the text of those specifications",
    and its treatment of relationship values is illustrative rather than prescriptive.

    Worth a comment at the point of use citing both, because AN002 is the better document on associated
    files generally, so someone reaching for it in good faith will find the wrong value and a fixture
    using Supplement will look like a bug to them.

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

    type/feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions