typst / svg2pdf

Converts SVG files to PDF.
Apache License 2.0
292 stars 38 forks source link

Minimum PDF/A support #81

Closed laurmaedje closed 2 months ago

laurmaedje commented 2 months ago

This is the absolute minimum of additions for PDF/A support (PDF/A-2b).

The API is not that great since there are various standard one can conform to and here it's just a bool, but maybe that is out of scope for the current svg2pdf architecture and should be revisited in the new architecture where Typst and svg2pdf share more code.

Concretely, these changes should result in all rules listed in the Typst tracking issue being satisfied by svg2pdf. The only problems I could find were:

Notably, only the notdef rule actually checks for PDF/A mode because the other rules turn out to apply to all PDF standards as far as I can tell!

I would release pdf-writer 0.11.1 before merging this.

LaurenzV commented 2 months ago

I think there are a few more points that require attention:

laurmaedje commented 2 months ago
LaurenzV commented 2 months ago

Strings: If I read the code correctly, you show each glyph with a separate invocation of the text showing operator

True, I forgot about that. 😅