Repository navigation
Description
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
/AFwritten on each of the six object types above, round-tripping through the reader.- Every
/AFRelationshipvalue exercised, plus a custom one. - A MathML-on-
Formulafixture usingSupplement, with the conflict noted in a comment citing both. qpdf --checkclean.
Relates to
- A2 — the file specifications this references.
- A5 — PDF/A-4F rule 6.9/4 requires
/AFRelationshipon embedded files. - v3.2 — attaching associated files to an existing document.
Activity
Tim81 commentedon Aug 29, 2026
A specification conflict to be aware of when implementing this, folded in from #363.
When presentation MathML is attached to a
Formulastructure element as an associated file, thesources disagree on which
/AFRelationshipvalue to use:SupplementshallSupplementAlternativeUse
Supplement. The two ISO documents are normative; AN002 says of itself that it "providesinterpretation 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
Supplementwill look like a bug to them.