[a11y] Automatically create outline (table of contents) metadata from page's headings (<h1>, <h2>, etc.) when printing/saving a page to PDF
Categories
(Core :: Printing: Output, enhancement)
Tracking
()
People
(Reporter: nekohayo, Unassigned)
References
(Blocks 1 open bug)
Details
Summary
Both for convenience and accessibility compliance reasons, in addition to the page title being preserved into the PDF title metadata (bug #1939532), when "printing" (saving) a page to PDF, the web browser engine should automatically create the dynamic table of content that gets shown in PDF readers' sidebars, which lists the headings and their corresponding page position (so that the software and the user can easily know the entire document structure and more easily navigate through it.
Here are two examples of pages that can serve as easy testcases, as they make good use of h1/h2/h3 headings:
- https://en.wikipedia.org/wiki/GNOME
- https://theconversation.com/what-canada-can-learn-from-the-european-union-about-dealing-with-chaos-and-crises-249462
Info about implementation in Skia
Searching for "pdf heading print" in Chromium's issue tracker, I found https://issues.chromium.org/issues/41387522 where we see mentions of the Skia graphics library where this feature is available, including:
- This merge request in Skia: https://skia-review.googlesource.com/c/skia/+/765519
- …merged as this resulting commit: https://skia.googlesource.com/skia/+/5075f1
Additional things I found:
- https://skia.org/docs/dev/design/pdftheory/
- https://api.skia.org/structSkPDF_1_1StructureElementNode.html ; I'm not sure if this is the right thing to use or not (through the a11y tree?)
- https://issues.chromium.org/issues/383706655 potentially related issue for headlines that have wrapped text
Reporter | ||
Updated•23 days ago
|
Comment 1•23 days ago
|
||
This would be one aspect of Tagged PDF generation.
(Currently, our PDF output is generated via cairo, not skia; presumably the cairo_tag_{begin,end}
APIs could be used to generate this.)
Description
•