![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
PDFs in Firefox: screen reader not recognising images' alt text
I use the NVDA screen reader to read aloud the contents of applications on my computer.
If I open a PDF in Adobe Acrobat, the screen reader will read aloud the content of the alt text associated with each image. When I open the same PDF in Firefox, however, the screen reader is evidently unable to recognise the presence of alt text; therefore it remains silent when it reaches an image - it's as if there's no alt text to be read.
Can you please clarify: is there a way for me to configure Firefox (either in the settings or in about:config) so that alt text in PDFs will be recognised by screen readers?
Tất cả các câu trả lời (4)
What does the page inspector show if you right-click such an image?
You can right-click and select "Inspect" to open the built-in Inspector with this element selected.
- https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/open_the_inspector/
- https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_and_edit_html/
See also:
Hi cor-el,
Thank you for your quick response.
Here are the results of the Inspector showing a page of a document including three images:
<canvas role="presentation" width="992" height="1404" style="width: 992px; height: 1404px;"><span class="structTree"><span role="group"><span lang="EN-AU" aria-owns="p1R_mc0"></span><span role="list"><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc3"></span></span></span><span lang="EN-AU" aria-owns="p1R_mc6"></span><span role="list"><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc9"></span></span></span><span lang="EN-AU" aria-owns="p1R_mc12"></span><span role="list"><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc15"></span></span></span><span lang="EN-AU" aria-owns="p1R_mc18"></span><span role="list"><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc21"></span></span></span><span lang="EN-AU" aria-owns="p1R_mc24"></span><span lang="EN-AU"><span role="figure" aria-owns="p1R_mc76" aria-label="This screensnip shows the locations of the Scan & OCR toolbar and the Recognize Text button. The Scan & OCR toolbar is displayed immediately below the persistent toolbar. The Recognize Text button is the third from the left on the Scan & OCR toolbar; its icon is two differently sized capital A's."></span><span aria-owns="p1R_mc25"></span></span><span lang="EN-AU" aria-owns="p1R_mc26"></span><span lang="EN-AU" aria-owns="p1R_mc27"></span><span role="list"><span role="list"><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc31"></span></span><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc35"></span></span><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc39"></span></span><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc43"></span></span></span></span><span lang="EN-AU" aria-owns="p1R_mc47"></span><span role="list"><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc50"></span></span></span><span lang="EN-AU" aria-owns="p1R_mc53"></span><span lang="EN-AU"><span role="figure" aria-owns="p1R_mc77" aria-label="This screensnip shows the location of the Recognize Text toolbar with English (UK) selected from the Language drop-down menu. The Recognize Text toolbar is displayed immediately below the Scan & OCR toolbar."></span><span aria-owns="p1R_mc54"></span></span><span lang="EN-AU" aria-owns="p1R_mc55"></span><span lang="EN-AU" aria-owns="p1R_mc56"></span><span role="list"><span role="list"><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc60"></span></span><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc64"></span></span></span></span><span lang="EN-AU" aria-owns="p1R_mc68"></span><span role="list"><span role="listitem"><span lang="EN-AU" aria-owns="p1R_mc71"></span></span></span><span lang="EN-AU" aria-owns="p1R_mc74"></span><span lang="EN-AU"><span role="figure" aria-owns="p1R_mc78" aria-label="This screensnip shows the "Converting scanned page to Searchable Image" progress bar for page 1 of the PDF."></span><span aria-owns="p1R_mc75"></span></span></span></span></canvas>
n.b. This code isn't displaying properly here; therefore I've attached a screensnip of the in-edit text.
Please let me know if you need further intel from my end.
Thanks, David.
Được chỉnh sửa bởi cor-el vào
The images aren't present in the text snip you posted. If I check a PDF file with images then I see two DIV elements on a page, one a canvaswrapper with the figures (images) and a second textLayer with the text. The canvaswrapper contains a canvas element with the images in a aria-label that is linked via aria-owns to the text layer (mc: markedContent), so there aren't real image tags in the file that could expose the alt attribute.
<span role="figure" aria-label="xxx.jpg" aria-owns="p1R_mc15"></span>
https://searchfox.org/mozilla-release/source/toolkit/components/pdfjs/content/web/viewer.js
Hi cor-el,
Thank you for your help. It seems clear to me that this isn't something that I'm going to be able to configure Firefox to manage. That in itself is worth knowing, so I appreciate your support.
Thanks, David.