WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

Improve PDF/UA support

Open liZe opened this issue 6 months ago • 2 comments

Fix #2363.

liZe avatar Jun 05 '25 10:06 liZe

This branch is ready to be tested.

Some improvements can/will be made, before merging or in a future issue:

  • ~warn users when they don’t set a document language or title~ (done),
  • ~warn users when they forgot an alt attribute on images~ (done),
  • dl elements are poorly tagged, there’s no 1:1 match between HTML and PDF structures,
  • PAC complains about some useless spans (just warnings),
  • ~hidden titles break levels consistency~ (that’s probably what we want).

Some bugs unrelated to this PR can affect PDF/UA validity, we’ll create new issues for them:

  • empty anonymous blocks are created sometimes, for example when list items are displayed as inline,
  • a paint operation is done when drawing all SVG tags, even the ones with nothing to draw.

liZe avatar Jun 06 '25 15:06 liZe

I tested the PR on our templates and with @alvarogf97 changes it seems to work almost perfectly (our templates are not perfect either :)

oraslaci avatar Jun 18 '25 07:06 oraslaci

#2482 has been opened to track other issues that are not fixed by this pull request. Time to merge! 🎉

liZe avatar Jun 21 '25 14:06 liZe