Kozea/WeasyPrint
GitHub で見るSVG: Unable to specify an alt text for screen readers
Closed
#2,816 opened on 2026年6月29日
featuregood first issue
Repository metrics
- Stars
- (6,291 stars)
- PR merge metrics
- (平均マージ 14d 23h) (30d で 10 merged PRs)
説明
Hello,
I have an SVG image embedded in my HTML file. I want to provide an alt text so that screen readers will provide a description of the image when reading the PDF out loud.
I have provided the tag in my SVG structure:
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="288pt" height="288pt" viewBox="0 0 288 288" xmlns="http://www.w3.org/2000/svg" version="1.1"><title>Tracé du parcours de la ligne 21.</title>...
and as you can see, it's being picked up by the browser:
However, in the PDF file created by Weasyprint, I don't see any title associated with the SVG file. Nothing is being read by the screen reader.
What is the best way to provide an alt text for svg images?
Here are the HTML and PDF files: SO21-20260106_21001231 (12).html SO21-20260106_21001231 (26).pdf
Thanks