Matterhorn 21-001 · PDF/UA-1 UA1:7.11-1

Attachment names in PDF: why both F and UF are required

BlockerCheckpoint 21: Embedded FilesWCAG 1.3.1 (A)

Embedded attachments must carry both the byte-string filename (F) and the Unicode filename (UF).

The condition, as the protocol states it. “The file specification dictionary for an embedded file does not contain F and UF entries.”

Matterhorn Protocol 1.1, checkpoint 21, index 21-001, section UA1:7.11-1. Software can decide this one on its own.

What a screen reader actually does

The attachment is announced with a mangled or missing name.

What is in the file

A PDF carries attachments in two ways. Document-level attachments, the ones in Acrobat’s Attachments panel, are listed in the /EmbeddedFiles name tree under the catalog’s /Names. Page-level ones are FileAttachment annotations, the paper-clip icons, each with an /FS entry. Both point at a file specification dictionary:

14 0 obj
<< /Type /Filespec
   /F    (budget.xlsx)                                % byte string
   /UF   <FEFF05EA05E705E605D905D1002E0078006C00730078> % "תקציב.xlsx", UTF-16
   /Desc (Approved budget, all departments)
   /EF   << /F 15 0 R >>                              % the embedded file itself
>>
endobj

/F is the original file specification string: bytes, with no declared character set. /UF, added in PDF 1.7, is a text string, which means PDFDocEncoding or UTF-16 with a byte-order mark, so any script survives. PDF/UA-1 clause 7.11 requires every embedded file’s specification to have both. The condition fires when either is missing.

What goes wrong without them

Without /UF, a viewer has only the bytes in /F and has to guess what they mean. Plain ASCII names survive the guess. Anything else does not. A Hebrew name written into /F by software that used the Windows-1255 code page, read the way PDF reads its own byte strings, turns דוח.csv into:

ãåç.csv

Something like that is what ends up in the attachments list, and what a screen reader reads aloud: three accented Latin letters and a file extension. With several attachments named like that, a user has no way to tell which is the budget and which is the minutes, short of opening each one.

Without /F, software that predates PDF 1.7 has no name at all to show.

Where it comes from

Libraries that treat the two names as separate calls. In Apache PDFBox, for example, PDComplexFileSpecification has setFile and setFileUnicode, and code that calls only the first writes /F and nothing else.

Producers older than PDF 1.7, which had no /UF to write.

How to check it free

Acrobat Pro lists the attachments: Menu → View → Show/Hide → Side panels → Attachments on Windows, View → Show/Hide → Side panels → Attachments on macOS (Open attachments in PDFs). A garbled name there is worth following up. A clean one proves nothing either way.

qpdf shows the dictionary. Write the readable form and search it for /Filespec:

qpdf --qdf --object-streams=disable report.pdf readable.pdf

Each specification should have both /F and /UF.

veraPDF, validating against PDF/UA-1, reports it under clause 7.11. Its rule is a little wider than the condition’s wording: it also rejects a /F or /UF that is present but empty, and it only looks at specifications that actually contain an embedded file (/EF).

How to fix it free

Fix the producer if you can. In code, set both names. In PDFBox, that is both setters, with the same file name.

Attach the file again in Acrobat Pro. Adobe documents adding a document-level attachment as Edit in the global bar, then in the right pane under ADD CONTENT, More → Attach file (Add attachments to PDFs), and removing a comment attachment by right-clicking it and choosing Delete (Add attachments as comments). Adobe does not document which entries Acrobat writes into the new specification, so check the result with qpdf or veraPDF.

Or add the missing key by hand. In the readable file, add /UF (budget.xlsx) next to /F. For a name outside ASCII, write it as UTF-16 hex with the FEFF byte-order mark, as in the example above. Then repair the offsets and write a normal file:

fix-qdf readable.pdf > edited.pdf
qpdf edited.pdf report-fixed.pdf

What Taggart does

The check collects every file specification in the /EmbeddedFiles name tree and every one behind a FileAttachment annotation, and reports each that lacks /F, /UF or both, with its object id:

An embedded file specification is missing /UF.

A specification behind a FileAttachment annotation is reported under 28-016 as well. The check asks whether the keys are there, as the condition is worded, so an empty /UF () passes it; veraPDF would reject that one.

The repair is embedded-file-names, marked safe, so Fix All Safe applies it. It copies whichever name exists into the one that is missing, and records the name it copied in the change log. Two limits follow from that.

If the specification has neither name, there is nothing to copy. Taggart leaves it alone and the finding stays, because a file name is not something it can work out.

If /F holds a name in a legacy code page, Taggart copies it the way PDF reads it, garbling included. The Windows-1255 example above becomes a /UF of ãåç.csv, and the change log says exactly that:

copied /F to /UF for ‘ãåç.csv’

The file then passes the check with a name nobody can read. So read the change log for any attachment whose name is not plain ASCII, and where the copied name is wrong, correct it in the source or by hand. Taggart does not guess which code page some earlier program used.

How Taggart handles it

Taggart checks for this condition automatically and reports it as a blocker, with where in the file it found it.

The fix is Add F and UF to embedded file specifications. It is mechanical, so “Fix All Safe” applies it along with the others in one pass and lists what it changed. Your original file is never modified.

Whatever Taggart changes, the page still looks identical. Fixes edit the PDF object model, not the content streams, and every remediation is re-rendered and compared against the original at structural similarity ≥ 0.999 before you get the file back. A tool that quietly reflows your document is worse than no tool.

Frequently asked questions

The attachment's name looks right in Acrobat. Can it still fail?

Yes. A viewer shows one name, and a correct-looking one only proves that the entry it read is fine. The condition is about both entries being present, and the only way to see that is to look at the file specification itself.

Why two names for one file?

History. /F is the original file specification string, a run of bytes whose character encoding was never pinned down, which is fine for plain ASCII and unreliable for anything else. /UF arrived in PDF 1.7 as a proper Unicode text string. ISO 32000-1 calls /UF optional but recommended alongside /F: /UF for getting the name right in any language, /F for older software that knows nothing else.

Does this cover the paper-clip attachments on a page?

Yes. A FileAttachment annotation points at a file specification through /FS, and that specification needs both names as well. Taggart reports a missing one there under this condition and under 28-016, which is the annotation's own condition.

What if the specification has neither name?

Then Taggart has nothing to copy, and it does not make a name up. The finding stays, and the name has to come from whoever made the file.

Where this sits in the standards

Standards this condition maps to
StandardReference
Matterhorn Protocol 1.1Checkpoint 21 (Embedded Files), index 21-001
PDF/UA-1 (ISO 14289-1)Clause 7.11-1
WCAG 2.11.3.1 Info and Relationships — Level A
EN 301 549 / Section 508 / ADA Title IIAll three point at WCAG 2.1 Level AA for non-web documents, so a Level A or AA criterion here is in scope for each of them.

Other conditions in checkpoint 21

Checkpoint 21 covers embedded files. These are its other failure conditions; the ones without a link are in the rule set but do not have a written page yet.

Check your own file. Taggart’s validator is free and unlimited — 75 of the 87 Matterhorn conditions software can decide, with the other 12 listed for you to confirm; no watermark, no expiry, and no account needed up to 60 pages.

Check a PDF free

Checked with Taggart on a generated file that fails this condition on . The Acrobat steps follow Adobe’s documentation and were not walked through by hand. Last updated .