Skip to content

Adobe Reader: support alternative text on formulas in PDFs#16067

Merged
seanbudd merged 2 commits into
masterfrom
i12715
Jan 22, 2024
Merged

Adobe Reader: support alternative text on formulas in PDFs#16067
seanbudd merged 2 commits into
masterfrom
i12715

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member
  • Adobe Acrobat vbuf backend: Don't replace content in formula tags with a space, rather only do this for math nodes. this ensures NvDA still exposes alt text on formulas. this approach still alows for supporting embedded mathml trees in NVDA, though this was never standardized in PDF.
  • Update what's new

Link to issue number:

Fixes #12715

Summary of the issue:

Authors of PDFs can provide alternative text on formular nodes via the 'alt' attribute. However, NvDA ignores this and replaces it with a single space, with the assumption that the formula will contain an inner mathml tree structure.
The idea of embedding a full mathml tree structure with in formula nodes was never standardized, and only a few experimental PDFs actually exist. However, it is becoming common for authors to place alt text (perhaps a simple english representation of math) on formula nodes.

Description of user facing changes

In Adobe Reader, alternative text for formulas will be reported if provided by the author.

Description of development approach

Adobe Acrobat vbuf backend: Don't replace content in formula tags with a space, rather only do this for math nodes. this ensures NvDA still exposes alt text on formulas. this approach still allows for supporting embedded mathml trees if they exist as a direct child of the formula.

Testing strategy:

  • Opened the pdf provided in NVDA does not read Formula tags in PDF #12715 in Adobe Reader. Arrowed up and down through the content ensuring that the formular was read.
  • Opened a pdf containing a mathml tree in a formular in Adobe Reader. Ensured that NvDA still reported the math using a Math Presentor such as MathCAT.

Known issues with pull request:

None known.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

…h a space, rather only do this for math nodes. this ensures NvDA still exposes alt text on formulas. this approach still alows for supporting embedded mathml trees in NVDA, though this was never standardized in PDF.
@michaelDCurran michaelDCurran requested a review from a team as a code owner January 19, 2024 02:01

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanbudd seanbudd merged commit fbfcd14 into master Jan 22, 2024
@seanbudd seanbudd deleted the i12715 branch January 22, 2024 00:57
@nvaccessAuto nvaccessAuto added this to the 2024.2 milestone Jan 22, 2024
@PaulRayius

Copy link
Copy Markdown

Thank you, thank you, thank you! (I'm looking forward to when this version is released!)

Nael-Sayegh pushed a commit to Nael-Sayegh/nvda that referenced this pull request Feb 15, 2024
…16067)

Fixes nvaccess#12715

Summary of the issue:
Authors of PDFs can provide alternative text on formular nodes via the 'alt' attribute. However, NvDA ignores this and replaces it with a single space, with the assumption that the formula will contain an inner mathml tree structure.
The idea of embedding a full mathml tree structure with in formula nodes was never standardized, and only a few experimental PDFs actually exist. However, it is becoming common for authors to place alt text (perhaps a simple english representation of math) on formula nodes.

Description of user facing changes
In Adobe Reader, alternative text for formulas will be reported if provided by the author.

Description of development approach
Adobe Acrobat vbuf backend: Don't replace content in formula tags with a space, rather only do this for math nodes. this ensures NvDA still exposes alt text on formulas. this approach still allows for supporting embedded mathml trees if they exist as a direct child of the formula.
SaschaCowley pushed a commit to SaschaCowley/nvda that referenced this pull request Feb 27, 2024
…16067)

Fixes nvaccess#12715

Summary of the issue:
Authors of PDFs can provide alternative text on formular nodes via the 'alt' attribute. However, NvDA ignores this and replaces it with a single space, with the assumption that the formula will contain an inner mathml tree structure.
The idea of embedding a full mathml tree structure with in formula nodes was never standardized, and only a few experimental PDFs actually exist. However, it is becoming common for authors to place alt text (perhaps a simple english representation of math) on formula nodes.

Description of user facing changes
In Adobe Reader, alternative text for formulas will be reported if provided by the author.

Description of development approach
Adobe Acrobat vbuf backend: Don't replace content in formula tags with a space, rather only do this for math nodes. this ensures NvDA still exposes alt text on formulas. this approach still allows for supporting embedded mathml trees if they exist as a direct child of the formula.
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
…16067)

Fixes nvaccess#12715

Summary of the issue:
Authors of PDFs can provide alternative text on formular nodes via the 'alt' attribute. However, NvDA ignores this and replaces it with a single space, with the assumption that the formula will contain an inner mathml tree structure.
The idea of embedding a full mathml tree structure with in formula nodes was never standardized, and only a few experimental PDFs actually exist. However, it is becoming common for authors to place alt text (perhaps a simple english representation of math) on formula nodes.

Description of user facing changes
In Adobe Reader, alternative text for formulas will be reported if provided by the author.

Description of development approach
Adobe Acrobat vbuf backend: Don't replace content in formula tags with a space, rather only do this for math nodes. this ensures NvDA still exposes alt text on formulas. this approach still allows for supporting embedded mathml trees if they exist as a direct child of the formula.
NSoiffer added a commit to NSoiffer/nvda that referenced this pull request Oct 10, 2024
…vaccess#16067)"

This partially reverts commit fbfcd14. That commit broke getting MathML from the document. While there were almost no MathML PDFs available in the past, pdftex can now generate MathML in Associated Files which are then exposed as the contents when a formula tag has role=math.

New code in NVDAObjects\IAccessible\adobeAcrobat.py handles any alternative text that gets exposed by the PDF processor.
NSoiffer added a commit to NSoiffer/nvda that referenced this pull request Oct 10, 2024
…e Reader: support alternative text on formulas in PDFs (nvaccess#16067)")

This change doesn't allow MathML in formula tags. That was ok before, but now pdftex puts out MathML in an associated file and FoxIt reader makes it the content of a formula tag.

Adobe is generally on board with this idea but hasn't implemented handling of associated files yet. Currently Adobe Reader does not know about Associated Files. So the contents are the alternative text. This is handled by making it an `mtext` element.

Note: if the alt text is LaTeX, then it has lots of "punctuation" such as `{` and `\`. This typically would _not_ be read by NVDA. MathCAT currently passes this along unchanged to NVDA, but I have marked this as a bug and will have MathCAT produce speech that won't be discarded, so the experience will be an improved one over just speaking the alt text.
NSoiffer added a commit to NSoiffer/nvda that referenced this pull request Oct 10, 2024
…e Reader: support alternative text on formulas in PDFs (nvaccess#16067)")

This change doesn't allow MathML in formula tags. That was ok before, but now pdftex puts out MathML in an associated file and FoxIt reader makes it the content of a formula tag.

Adobe is generally on board with this idea but hasn't implemented handling of associated files yet. Currently Adobe Reader does not know about Associated Files. So the contents are the alternative text. This is handled by making it an `mtext` element.

Note: if the alt text is LaTeX, then it has lots of "punctuation" such as `{` and `\`. This typically would _not_ be read by NVDA. MathCAT currently passes this along unchanged to NVDA, but I have marked this as a bug and will have MathCAT produce speech that won't be discarded, so the experience will be an improved one over just speaking the alt text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA does not read Formula tags in PDF

4 participants