docs
docs copied to clipboard
add accessibility tree to PDF export file (Tagged PDF))
label: accessibility
When I use structure (headers, lists…) in a Docs document
Then it should be reflected in the corresponding PDF exported file (= Tagged PDF).
reference: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#page=581
This an accessibility requirement.
ping @cyberbaloo
cf https://pdfkit.org/docs/accessibility.html
Hello !
After investigation, I confirmed that our exported PDFs are not tagged (“Tagged PDF: No” in Acrobat). This means the document’s logical structure (headings, lists, tables, etc.) is not preserved in the PDF, which fails the accessibility requirement.
The root cause is that @react-pdf/renderer does not currently support generating tagged PDFs. There’s already an open issue on their repository about this limitation: https://github.com/diegomura/react-pdf/issues/3179.
To meet the requirement, we would need to switch to a PDF generation tool that supports tagged PDF output, such as an HTML→PDF engine (PrinceXML, Antenna House, etc.) or a PDF library with full tagging support.
I tag @virgile-dev
Thanks that’s something that will be of interest for @YousefED as well
explicit #758
Maybe look at the side of Typst
Note that there are some rules in PDF/UA that are crucial for accessibility but cannot be automatically checked. Hence, when exporting a PDF/UA-1 document, make sure you did the following:
If your document is written in a different language than English, make sure set the text language before any content. Make sure to use Typst's semantic elements (like headings, figures, and lists) when appropriate instead of defining custom constructs. This lets Typst know (and export) the role a construct plays in the document. See the Accessibility guide for more details. Do not exclusively use contrast, color, format, or layout to communicate an idea. Use text or alternative descriptions instead of or in addition to these elements. Wrap all decorative elements without a semantic meaning in pdf.artifact. Do not use images of text. Instead, insert the text directly into your markup.
@Ovgodd I'm closing this here as it needs to be fixed on the libraries side. Please link the issues here when you've created them on the other repos. Thanks