-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF/A docs #35
PDF/A docs #35
Conversation
- CIDFont `FontDescriptor` attributes - Horizontal / Vertical writing mode in CMap and CMap Dictionary - Font descriptor overrides for character classes
cc @LaurenzV |
Disclaimer: Apart from the Typst issue where you list some of the points needed to get the compliance, I'm not very familiar with them. I personally feel like this crate is at the wrong level of abstraction to implement PDF/A compliance checks. So I think that for now, those checks should to be performed in Typst, and in the future all of this will hopefully be moved into a more higher-level PDF-drawing crate. But just my two cents! Regarding q-nesting level, is it really as easy as checking the q's in a single content stream? I would have thought that the purpose of such a restriction is to prevent stack-explosion, but if the q-nesting level is just counted separately in each content stream, one could invoke an XObject instead and then basically reset the q-nesting level. Am I missing something here? As mentioned, unfortunately I don't have access to the spec. |
Most of these changes seem very valuable. I especially like all the new notes regarding PDF/A compliance. But I agree with @LaurenzV that the compliance checks seem out of place here. In my ("pdf-unexperianced") opinion, the checks should be separated from the other additions and added documentation. They could be discussed further, while the rest of this PR, in my opinion, could be merged as is. Note though, that I am very new to PDF/A (and to be honest, to PDF in general). |
This PR is about adding PDF/A-oriented features to
pdf-writer
:WMode
to the CMap and CMap dictionary writers to support a cautious interpretation of clause 6.2.11.3.3 in ISO 19005-2:2011.Because of the last change, the other attributes in table 124 of the PDF 1.7 spec were also added.
The return type of
Catalog::output_intents
has been changed fromTypedArray<'_, Dict>
toTypedArray<'_, OutputIntent>
which is a breaking change.Laurenz and I discussed whether returning results is the correct way to proceed here, as very few of the
PdfaError
s are actionable. For example, a consumer cannot fix aDeviceN
color space with more than 8 colorants and will just unwrap. We discussed whether collecting the compliance in theChunk
would be a better idea, however, this would be difficult becauseContent
andUnicodeCmap
are stand-alone structs with noChunk
reference. Furthermore, are consumers free to opt out from running these checks? Given these open questions, I have marked this PR as a draft and invite comments.