搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

PDFs in Firefox: screen reader not recognising images' alt text

  • 4 个回答
  • 0 人有此问题
  • 45 次查看
  • 最后回复者为 david.zilko

more options

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?

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?

所有回复 (4)

more options

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.

See also:

more options

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 &amp; OCR toolbar and the Recognize Text button. The Scan &amp; OCR toolbar is displayed immediately below the persistent toolbar. The Recognize Text button is the third from the left on the Scan &amp; 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 &amp; 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 &quot;Converting scanned page to Searchable Image&quot; 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.

由cor-el于修改

more options

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

more options

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.