WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

Support PDF/A with tagged content

Open luca-vercelli opened this issue 6 months ago • 3 comments

Hello, I have been requested to produce PDF/A files with accessibility support. This means files should pass accessibility tests such as mauve.

I produced both a PDF/A-3 and a PDF/UA file with weasyprint. The PDF/UA succeeds in the tests. The PDF/A fails some tests:

  • Ensuring correct tab and reading order in PDF documents
  • Use tags to specify PDF's logical structure framework
  • Providing headings by marking content with heading tags in PDF documents
  • Specifying the document title using the Title entry in the document information dictionary of a PDF document

Do you think there is some way to achieve the goal?

Please note this is not a stupid goal. In public administration both long-term support and accessibility support are required.

luca-vercelli avatar May 30 '25 08:05 luca-vercelli

Hi!

Please note this is not a stupid goal. In public administration both long-term support and accessibility support are required.

We’re currently working to improve PDF/UA support. These requirements look like PDF/A + accessibility tags, which should be possible when #2363 is fixed.

liZe avatar May 30 '25 11:05 liZe

Hi!

If you’re interested in this issue, it’s time to test #2471! Adding the --pdf-variant=pdf/a-3b --pdf-tags options should do what you want. Feedback will be highly appreciated, even to say that it just works. 🙏

The only big issue I’ve found with Mauve++ is about headings. Headings are actually in the PDF, but not directly in the stream (they are in spans nested in the tag tree). I think that it’s more a limitation of Mauve++ than a real accessibility problem, even if we should avoid these useless spans when possible: that in our list for the future in #2471.

liZe avatar Jun 06 '25 16:06 liZe

Tested: it works! thank you.

luca-vercelli avatar Jun 10 '25 09:06 luca-vercelli