ITADN

Minimum PDF/A support

#81Pull Requestlaurmaedje 创建于 2024-09-27已合并
L
laurmaedjecommented
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](https://github.com/typst/typst/issues/2942) being satisfied by svg2pdf. The only problems I could find were: - Name length for font names: I adjusted the code to trim them. - Maximum q nesting depth: I added a method to pdf-writer to track the depth (tracking it here would make the code uglier). I think that's generally useful. However, the validation itself happens in svg2pdf. When the nesting depth is too high, a new `TooMuchNesting` error is returned. In theory, we could use XObjects to reset the depth, but that is too much work right now. - Notdef glyphs: When they are found and PDF/A support is enabled, a new `MissingGlyphs` error is returned. 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.
合并状态:已合并 合并于 2024-09-30 关闭于 2024-09-30 3 条评论