What Is AFRelationship?
AFRelationship (Associated File Relationship) is a metadata property used in PDFs to describe the relationship between a PDF document and an embedded file (attachment).
It was introduced with the Associated Files (AF) mechanism in the PDF specification and is heavily used in modern PDF/A standards.
AFRelationship tells software and archives:
Why is this file attached to the PDF?
Without AFRelationship, an attachment may be considered invalid for PDF/A compliance.
Why AFRelationship Matters
When a file is embedded in a PDF/A document:
- The attachment must have a MIME type.
- The attachment should have a meaningful AFRelationship value.
- PDF validators use AFRelationship to verify compliance.
Examples:
| Attachment | AFRelationship |
|---|---|
| Original XML invoice | Source |
| Spreadsheet used to generate report | Data |
| Alternative representation of content | Alternative |
| Supplementary information | Supplement |
| Unknown relationship | Unspecified |
Full AFRelationship Value List
The PDF specification defines the following standard values.
1. Source
The embedded file is the source from which the PDF was generated.
Examples:
- XML invoice attached to a PDF invoice
- Word document used to create a PDF
- CAD source file
AFRelationship = Source
Typical Use Cases
- ZUGFeRD invoices
- Factur-X invoices
- PDF generated from DOCX
2. Data
The attachment contains data referenced by the PDF.
Examples:
- CSV datasets
- XML transaction data
- Measurement data
- Database exports
AFRelationship = Data
Typical Use Cases
- Scientific reports
- Financial reports
- Engineering measurements
3. Alternative
The attachment represents the same information in another format.
Examples:
- PDF + HTML version
- PDF + XML representation
- PDF + plain text version
AFRelationship = Alternative
Typical Use Cases
- Accessibility
- Machine-readable versions
- Multi-format archiving
4. Supplement
The attachment provides additional information.
Examples:
- Reference materials
- Supporting documents
- Appendices
- Manuals
AFRelationship = Supplement
Typical Use Cases
- Technical documentation
- Engineering projects
- Research archives
5. EncryptedPayload
The attachment contains encrypted content.
AFRelationship = EncryptedPayload
Used primarily in secure workflows.
Not commonly seen in PDF/A archival documents.
6. FormData
The attachment contains form submission data.
Examples:
- XFDF
- FDF
- XML form export
AFRelationship = FormData
Typical Use Cases
- Interactive forms
- Government forms
- Enterprise workflows
7. Schema
The attachment contains schema definitions.
Examples:
- XSD files
- JSON schemas
- Validation definitions
AFRelationship = Schema
Typical Use Cases
- XML-based document packages
- Structured archives
8. Unspecified
Relationship is unknown or not declared.
AFRelationship = Unspecified
Use only when no other value accurately describes the relationship.
Many validators accept it, but archival best practice is to use a more specific value whenever possible.
Comments
Post a Comment