Checkpoint 21: Embedded Files
When PDFs contain embedded files (attachments), each file must have a proper file specification dictionary that includes both the F (file name) and UF (Unicode file name) keys. This ensures assistive technology can identify and describe embedded files to users.
What This Means
PDFs can contain embedded files as attachments. Common embedded file types include:
- Source documents: Original Word, Excel, or other files
- Supporting data: Spreadsheets, databases, or datasets
- Additional resources: Related documents or references
- Multimedia: Audio or video files
- Archives: ZIP files or other compressed archives
Each embedded file requires a file specification dictionary that describes the file. This dictionary must contain:
- F key: The file name in a basic encoding (typically PDFDocEncoding or ASCII)
- UF key: The file name in Unicode (UTF-16BE), supporting international characters
Both keys are required because:
- The F key provides backward compatibility with older PDF readers
- The UF key ensures correct display of file names containing non-ASCII characters (accented letters, Asian characters, symbols)
- Assistive technology uses these keys to announce the file name to users
Why It Matters
Proper file specification affects how users with assistive technology interact with embedded files:
File identification:
- Screen readers announce file names when users encounter attachments
- Without proper naming, users cannot know what files are embedded
- Missing or incorrect names prevent informed decisions about opening attachments
International character support:
- The UF key ensures file names display correctly regardless of language
- Without Unicode support, file names like "Rapport_financier_2024.xlsx" or "レポート.pdf" may display incorrectly
- Users may not recognize garbled file names
Link text equivalents:
- When embedded files are linked from document text, the file name often serves as or supplements the link text
- WCAG 2.4.4 (Link Purpose) requires that link purpose be determinable
- Proper file names help satisfy this requirement
Security awareness:
- Users need to see file names to make informed decisions about opening attachments
- Hidden or unclear file names could mask malicious content
- Accessibility supports security through transparency
Consider a user navigating a PDF with a screen reader. When they encounter an attachment:
| With proper F/UF keys | Without proper keys |
|---|---|
| "Attachment: Budget_2024.xlsx" | "Attachment: (unknown)" |
| "Attachment: Contrat_de_service.pdf" | "Attachment: file1" |
| "Attachment: " | "Attachment: " |
Common Violations
The Matterhorn Protocol defines one failure condition for embedded files, which is machine testable.
21-001: File Specification Dictionary Missing F and UF Keys (Machine Testable)
What's Wrong: An embedded file's specification dictionary is missing either the F key, the UF key, or both. This prevents proper identification of the embedded file.
How to Identify:
- PDF/UA validators automatically detect missing F or UF keys
- In Acrobat, go to View > Show/Hide > Navigation Panes > Attachments
- If attachments show blank names or garbled characters, keys may be missing
- Validation tools will specify which key is missing
Technical Context: A proper file specification dictionary looks like:
<< /Type /Filespec
/F (filename.pdf)
/UF <FEFF0066006900...> % Unicode UTF-16BE encoded filename
/EF << /F (embedded stream reference) >>
/Desc (File description)
>>
Common issues include:
- F key present, UF missing: File names with special characters may not display correctly
- UF key present, F missing: Older PDF readers may not show the name
- Both missing: File cannot be identified at all
- Empty values: Keys exist but contain no data
Why Both Keys Are Required:
- PDF/UA requires both for maximum compatibility
- F key: Works with older readers, uses restricted character set
- UF key: Supports full Unicode, required for international file names
- Together, they ensure all users can identify attachments regardless of reader or language
How to Fix in Adobe Acrobat
Adobe Acrobat provides tools for managing embedded files, though fixing file specification issues may require workarounds.
Viewing Embedded Files
- Open your PDF in Adobe Acrobat Pro
- Go to View > Show/Hide > Navigation Panes > Attachments
- The Attachments panel shows all embedded files
- Note any files with missing or incorrect names
Re-embedding Files with Proper Names
If file specifications are missing, re-embedding often fixes the issue:
- In the Attachments panel, note the problematic file
- If possible, save the attached file locally:
- Right-click the attachment
- Select Save Attachment
- Save to a local folder
- Delete the problematic attachment:
- Right-click the attachment
- Select Delete
- Re-add the file with a proper name:
- Click the Add Attachment button (paperclip icon)
- Navigate to and select the saved file
- Ensure the file has a proper, descriptive name before attaching
Checking File Properties
- In the Attachments panel, right-click an attachment
- Select Properties or Description (option varies by version)
- Review the file name and description
- Edit the description to add meaningful information
Adding Attachment Descriptions
While not a direct fix for F/UF keys, descriptions help:
- Right-click an attachment
- Select Edit Description
- Add a clear description of the file's contents
- This provides additional context for screen reader users
Using Preflight for Diagnostics
- Go to Tools > Print Production > Preflight
- Search for "embedded file" or "file specification" profiles
- Run the check to identify missing keys
- Review results for specific failures
- Preflight may offer fixups for some issues
Advanced: Editing File Specifications
For technical users with PDF editing knowledge:
- Some third-party tools allow direct dictionary editing
- You can add missing F or UF keys manually
- This requires understanding PDF structure and encoding
- Tools like QPDF or iText can be used programmatically
How to Fix in Source Applications
Preventing file specification issues starts with how attachments are created.
Adobe InDesign
When embedding files in InDesign publications:
- Use File > Place or the Links panel to add files
- Ensure source files have proper, descriptive names before embedding
- Avoid special characters in file names that may not encode properly
- When exporting to PDF:
- Check that embedded files are included
- Test the resulting PDF for proper file specifications
Microsoft Word
Word can include embedded objects:
- Use Insert > Object to embed files
- Ensure the source file has a clear name
- When saving as PDF:
- Embedded objects may or may not transfer
- Test the PDF to verify attachments
- For true file attachments, consider using Acrobat after Word export
Adding Attachments via Script or Automation
When programmatically creating PDFs with attachments:
- Always specify both F and UF parameters
- Encode the UF value as UTF-16BE (big-endian Unicode)
- Use the same file name in both F and UF (with appropriate encoding)
- Include a description for accessibility
Example using a PDF library (conceptual):
// Pseudocode for proper attachmentpdf.attachFile({path: '/path/to/file.pdf',name: 'Annual_Report_2024.pdf', // F keyunicodeName: 'Annual_Report_2024.pdf', // UF key (auto-encoded)description: 'Complete annual report with financial details'});
File Naming Best Practices
Before embedding files:
- Use descriptive names: "Q4_Financial_Summary.xlsx" not "doc1.xlsx"
- Avoid special characters: Stick to alphanumeric, underscore, hyphen
- Include file type context: Name should hint at content type
- Keep names reasonable length: Long enough to be clear, short enough to display
- Use ASCII-compatible characters when possible: Reduces encoding complexity
Testing Your Fix
Automated Testing
PAC (PDF Accessibility Checker):
- Open the PDF in PAC
- Run the PDF/UA check
- Navigate to Checkpoint 21 results
- PAC will report missing F or UF keys
- The violation is machine testable with specific results
veraPDF:
- Select PDF/UA-1 validation profile
- Run validation
- Look for file specification rule failures
- Results will identify which files have issues
Adobe Acrobat Preflight:
- Go to Tools > Print Production > Preflight
- Run a PDF/UA compliance check
- Review results for embedded file issues
- Check for specific file specification failures
Manual Verification
- Open the Attachments panel in Acrobat
- Review each attachment name:
- Names should be visible and readable
- No blank entries or garbled characters
- Names should describe the file content
- Try to open each attachment to verify it's accessible
Screen Reader Testing
- Open the PDF with a screen reader (NVDA, JAWS, VoiceOver)
- Navigate to the attachments area
- Verify the screen reader announces:
- That attachments exist
- The name of each attachment
- Any available descriptions
- Confirm users can access and open attachments
International Character Testing
If file names include non-ASCII characters:
- Embed a file with international characters in the name
- Open the PDF in different readers (Acrobat, browser, Preview)
- Verify the name displays correctly in all viewers
- Test with a screen reader to ensure proper pronunciation/spelling
Validation Checklist
- All embedded files have F key present
- All embedded files have UF key present
- F and UF values are not empty
- File names are descriptive and meaningful
- File names display correctly (no garbled characters)
- Attachments panel shows proper names
- Screen reader announces file names correctly
- File descriptions are provided where helpful
- Users can access and open attachments
Common Scenarios and Solutions
Scenario 1: File Names with Accented Characters
Problem: File name "Présentation_été.pdf" displays incorrectly.
Solution:
- The UF key must be present for proper Unicode display
- Re-embed the file ensuring the PDF tool supports Unicode
- Alternatively, rename to ASCII-compatible: "Presentation_ete.pdf"
Scenario 2: Attachment from Legacy PDF
Problem: Old PDF has attachments without proper specification.
Solution:
- Save existing attachments locally
- Delete from the PDF
- Re-attach using modern Acrobat
- Verify F and UF keys are now present
Scenario 3: Programmatically Generated PDFs
Problem: PDF library doesn't add UF key by default.
Solution:
- Check library documentation for Unicode file name options
- Explicitly set both F and UF parameters
- If library doesn't support UF, consider post-processing with another tool
- File a feature request with library maintainers
Scenario 4: Multiple Languages in Attachment Names
Problem: Document has attachments in multiple languages.
Solution:
- Ensure UF key is present for all (required for non-ASCII)
- F key can use ASCII approximation if needed
- Add descriptions in the document's primary language
- Test with appropriate language screen reader settings
Additional Resources
Official Standards and Guidelines
- W3C WCAG 2.1 Success Criterion 1.1.1: Non-text Content
- W3C WCAG 2.1 Success Criterion 2.4.4: Link Purpose (In Context)
- PDF Association Matterhorn Protocol 1.02
PDF Technical Resources
- PDF Reference: File Specification Dictionaries
- ISO 32000-2 (PDF 2.0) Standard
- PDF/UA Technical Implementation Guide
Tools
- PAC (PDF Accessibility Checker) - Free PDF/UA validation
- veraPDF - Open-source PDF validator
- Adobe Acrobat Pro - Attachment management
- QPDF - Command-line PDF manipulation
This documentation is based on the Matterhorn Protocol 1.02, the definitive reference for PDF/UA validation. The embedded files checkpoint has one machine-testable failure condition. For the most current information, consult the PDF Association and W3C WCAG guidelines.