I have a website where the users can download & view PDFs in browser. I noticed when running an accessibility report on those pages, they are failing in the following two issues:
title
element to aid in navigation.html
element must have a lang attribute.The browser page that the PDF sits on does have a title
and lang
attribute, I can confirm.
I gather this is related to the actual PDF, so I downloaded it then opened it in Adobe Acrobat Reader. If I then go to File > Properties > Description, I can see the document does have a title
field. Equally, if I go to the Advanced tab I can see the language is set to en-GB
.
Can anyone advise on why it is therefore failing the accessibility scan on those elements?
These errors concern the PDF viewer integrated in the browser, and there is nothing you can do about that.
Both Firefox and Chrome do not assign a language to the HTML that is loading the viewer in the tab. Firefox does expose the document title in <title>
, Chrome does not (the whole <head>
is empty).
You can provide hints, but cannot control which software opens the linked PDF on the user’s system.
You should make sure that the link makes clear that the target is a PDF file, so that users can take a choice how to treat the link. They might choose to download it from the context menu and then open it in their desktop application.
Many users prefer to know the file type when opening a file that results in opening a new application to view the file, so it is often regarded as useful to include this additional information. However, this is not required for compliance with this Success Criterion.
It’s also helpful to state whether the linked PDF is accessible or not.
Example: Welcome Book (PDF, not tagged for accessibility)