Replace raw URLs in PDFs with descriptive text
When a link's visible text cannot say where it goes, a raw URL or a shortened code, the Link tag can carry an Alt entry with replacement text. W3C publishes PDF13 as a sufficient technique, and it is a repair rather than a first choice. W3C says so itself, that this is usually not necessary and belongs to the situations where something beyond the visible text is genuinely needed. Two things follow from how it works. The Alt entry replaces the link text completely, so screen readers ignore every visible word inside the tag and read only what you wrote. And because the replacement is read in the flow of the sentence around it, it has to make sense there. Acrobat Pro's Create Link command is the usual route.
How we find it in an audit
We read the links list with a screen reader and flag entries that are raw URLs or opaque codes. Then we check in the tag tree whether those Link elements carry an Alt entry describing the destination, and we listen to the whole sentence rather than the link alone, because replacement text that reads well in a list can land badly in context.
How affected users experience it
A raw URL is read out character by character for half a minute, and the user still does not know it is the appeal form. In the links list, five tracking URLs are indistinguishable from one another.
Passes vs. fails
Passes
The link keeps the printed URL on the page, and its Link tag carries the Alt text "Online appeal form for this decision". That is what the links list announces, and it reads correctly in the sentence too.
Fails
A benefits decision letter's only route to appeal is the printed URL "https://svc.example.gov/f/29b7c". The screen reader spells it out, character by character.
How this gets tested
The W3C publishes test rules that define what a checker looks for here.
- Link has non-empty accessible nameA tool can check this
- Link in context is descriptiveA tool can check this
- Links with identical accessible names and same context serve equivalent purposeA tool finds candidates, you decide
- Link is descriptiveA tool can check this
- Links with identical accessible names have equivalent purposeA tool can check this
Other ways to satisfy this rule
22 guides on this site are filed under 2.4.4 Link Purpose (In Context). W3C lists this one as sufficient for that rule only alongside G91, so the pair is what passes and neither half does on its own.
- ARIA7sufficientBuild clear link names from nearby headings
- ARIA8sufficientFix vague link text with aria-label
- C7sufficientAdd hidden text to clarify short links
- G53sufficientLet the sentence around a link explain it
- G91sufficientWrite link text that states its purpose
- G189sufficientOffer a switch to self-describing link text
This guide is our interpretation of W3C technique PDF13: Providing replacement text using the /Alt entry for links in PDF documents. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.