pypdf
pypdf copied to clipboard
ENH: Add alt text to images
I would like to programmatically add alternative texts for screen readers to images. Is that possible right now?
The way the feature could be used is to identify a node (using some kind of object id) and then adding an alt text with a method call on the node. Then one would write the new PDF document back to a file.
I don't know if the pdf format supports it. Feel free to add this feature
It's definitely supported but I don't know how exactly. Acrobat has a feature to add alt texts in the accessibility tools. It usually requires that a document is tagged.
Unfortunately I don't have the time to add this feature right now and I would need more guidance on how to add it.
I did a quick search on internet and found this page: https://www.umaryland.edu/cpa/toolbox/website-manual/accessibility/instructions-for-pdfs/working-with-alternate-text-in-acrobat/
It looks like alternative text depends on tagging. To confirm that, can you share a PDF file with such alternative texts?
https://dl.acm.org/doi/pdf/10.1145/3517428.3544796 has alt texts for the images. The document looks tagged to me.
Hi, thanks for the great work! Is there any roadmap for supporting this feature?
No, there is no general roadmap for the pypdf issues, but anyone interested in this is free to give it a try and open a corresponding PR.