NEW 288719
AX: [a11y] Automatically create outline (table of contents) metadata from page's headings (<h1>, <h2>, etc.) when printing/saving a page to PDF
https://bugs.webkit.org/show_bug.cgi?id=288719
Summary AX: [a11y] Automatically create outline (table of contents) metadata from pag...
Jeff Fortin
Reported 2025-02-27 07:30:44 PST
Created attachment 474369 [details] Screenshot of the PDF generated by Safari, lacking an outline in the sidebar ## Summary Both for convenience and accessibility compliance reasons, in addition to the page title being preserved into the PDF title metadata (bug #285313), 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. Currently, neither Safari (WebKit) nor Epiphany (WebKitGTK) do that, as can be seen in the attached screenshots of the resulting PDFs. Here are some examples of pages that can serve as easy testcases, as they make good use of h1/h2/h3 headings: * https://en.wikipedia.org/wiki/WebKit * 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 Corresponding requests on the Firefox side: * https://bugzilla.mozilla.org/show_bug.cgi?id=1939532 * https://bugzilla.mozilla.org/show_bug.cgi?id=1950656
Attachments
Screenshot of the PDF generated by Safari, lacking an outline in the sidebar (624.62 KB, image/png)
2025-02-27 07:30 PST, Jeff Fortin
no flags
Screenshot of the PDF generated by WebKitGTK (PDF reader does not show an outline section for it in the sidebar) (295.89 KB, image/png)
2025-02-27 07:31 PST, Jeff Fortin
no flags
Radar WebKit Bug Importer
Comment 1 2025-02-27 07:31:00 PST
Jeff Fortin
Comment 2 2025-02-27 07:31:39 PST
Created attachment 474370 [details] Screenshot of the PDF generated by WebKitGTK (PDF reader does not show an outline section for it in the sidebar)
Note You need to log in before you can comment on or make changes to this bug.