Image alt text not being converted to alt tags in PDF/UA
Thank you for this library, it has been very helpful for our work!
We are creating PDFs that contain a lot of map images using variant="pdf/ua-1".
Within our HTML, we are assigning these alt tags in the normal way for HTML.
<img src="..." alt="My image" />
However, these seem to be missing Alt tags when converted to PDF/UA, and so they are failing accessibility checks.
I don't quite follow how these are converted into tags in PDF/UA, but it seems like it should be possible in theory to retain the alt tag when processing the image and convert it into the associated alt tag in PDF/UA.
I didn't see examples to clarify if there was another way to properly tag images.
Possibly related: #1838
Hi!
Yes, unfortunately, many things are not handled with PDF/UA support yet.
I don't quite follow how these are converted into tags in PDF/UA, but it seems like it should be possible in theory to retain the alt tag when processing the image and convert it into the associated alt tag in PDF/UA.
Tags are set in the stream.py file and structured in the pdfua.py file, where you have ElementTree elements (ie. HTML tags transformed into Python objects) and thus alt attributes. By changing these two functions, it should be possible to put the alt attributes into correct PDF tags.
+1 interested also for the "alt" on image during PDF export
+1 interested also for the "alt" on image during PDF export
If someone wants to add the feature, I’ll be happy to help! The previous comment already contains useful tips.