docs icon indicating copy to clipboard operation
docs copied to clipboard

add accessibility tree to PDF export file (Tagged PDF))

Open Erwan-le-Gall opened this issue 5 months ago • 6 comments

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.

Erwan-le-Gall avatar Jul 07 '25 14:07 Erwan-le-Gall

ping @cyberbaloo

Erwan-le-Gall avatar Jul 10 '25 13:07 Erwan-le-Gall

cf https://pdfkit.org/docs/accessibility.html

Erwan-le-Gall avatar Jul 16 '25 10:07 Erwan-le-Gall

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

Ovgodd avatar Aug 11 '25 07:08 Ovgodd

Thanks that’s something that will be of interest for @YousefED as well

virgile-dev avatar Aug 20 '25 12:08 virgile-dev

explicit #758

Erwan-le-Gall avatar Aug 26 '25 09:08 Erwan-le-Gall

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.

cyberbaloo avatar Nov 05 '25 11:11 cyberbaloo

@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

virgile-dev avatar Nov 14 '25 14:11 virgile-dev

@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

Hello ! this is the issue created on BlockNote side : 2178

Ovgodd avatar Nov 17 '25 09:11 Ovgodd