Language changes not available to assistive technologies
See original GitHub issueAttach (recommended) or Link to PDF file here: test-lang.pdf The default language in this document is english. But the document contains 2 language changes.
Configuration:
- Web browser and its version: Firefox 93.0
- Operating system and its version: Windows 10 Version 1909 Build 18363.1256
- PDF.js version: from the master branch
- Is a browser extension: no
- Screen reader: NVDA 2021.2
- OS language: english
Steps to reproduce the problem:
- Open the file in PDF.js
- Read the file with NVDA
- The text in French is read with an English voice (in Acrobat, the text in French is read with a French voice)
What is the expected behavior? (add screenshot) French text should be read with a French voice.
In this PDF document, the content in French is made of two tags, one H1 and one P. These two tags have the property Language set to “French”. This info should be available as a lang
attribute in the DOM set to “French”, so that screen readers like NVDA can select the correct language to read this text.
What went wrong? (add screenshot) Here the only lang attribute we have in the DOM is the one of the default language. We should find 2 others, one for the title in French and one for the paragraph in French.
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): /
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (1 by maintainers)
Top GitHub Comments
Just in case it could help, I have made a small test case for this issue: https://codepen.io/alainvagner/full/GRvBaBB
That clarifies things. Relative to that, this should be easy enough to fix in Gecko. I just need to find the time to write the patch.