Please note that success criterion 1.1.1 uses the following definition of text alternative (emphasis added):
Text that is programmatically associated with non-text content or referred to from text that is programmatically associated with non-text content. Programmatically associated text is text whose location can be programmatically determined from the non-text content.
Based on the question whether a PDF file is acceptable, I assume that the image requires a long description. However, even in that case, the
alt attribute cannot be omitted; it should briefly identify the image and possibly mention where a longer description is available.
longdesc attribute is one way of linking to a longer description (in addition to, not instead of, the
alt attribute). Note that the
longdesc attribute may contain a link to a different page or to a different location on the same page (using a fragment identifier).
Due to poor support for
longdesc, there are a number of alternatives, such as using
aria-describedby or linking to a long description from a
figcaption element (which would be programmatically associated with the
figure element enclosing the
One of the best solutions I have seen so far is the following:
- enclose the
img element in a
- add a
- inside the
figcaption element, use
details element for the actual figure caption text and a
summary element for the long description.
This allows you to have everything on the same page without cluttering the page for those who don't need to see the long description.
I would advise against making the long description available only in a PDF file. You might be able to argue that it meets the letter of WCAG 2.1 SC 1.1.1 if you link to it from a
figcaption element, but as a certified auditor, I would never let this pass without a strong recommendation to use an HTML-based technique. Forcing screen reader users to open or download a PDF file for a long description does not constitute equal access, even if the PDF is accessible.
Linking to a PDF file instead of using an
alt attribute would constitute an unequivocal violation of SC 1.1.1.