-
-
Notifications
You must be signed in to change notification settings - Fork 696
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 attachments are not PDF/A-3 compliant #1869
Conversation
SubType, CreationDate and ModDate were added
Sorry for the awfully loooooooong time to comment this PR. We need some time and some real-life testers to improve PDF/A and PDF/UA. We have other related issues we’d like to solve too, we’ll probably take care of all of them at the same time, sometime in the future. |
I've tested this by generating a PDF for an RFC and producing PDF/A-3B compliant documents. 🎉
|
@timoramsauer @kesara Thanks! I’ve updated the PR to handle PDF/A specificities only when actually generating PDF/A files. I’ve also (hopefully!) followed the different rules for A-1b, A-2b and A-3b (A-4b is not tested yet by VeraPDF). Tests are welcome! |
This works for me. Thanls! |
@liZe, For example in #2052, I get an error with the latest changes:
|
Everything should be fixed now, thanks for the feedback! (And don’t hesitate to add a comment if there’s anything wrong.) |
I compile a file with file attachments using anchors.
pdf_variant
is set topdf/a-3b
.Checking the pdf with veraPDF problems are found:
Furthermore,
ModDate
is missing even though it is required by spec.The following attributes were added:
EmbeddedFile/CreationDate
(technically not required for compliance)EmbeddedFile/ModDate
EmbeddedFile/MimeType
Filespec/AFRelationship
Catalog/AF
This pull request works for me as I only compile to pdf/a.
I understand that this might not be a general fit and I'm happy to adjust it.
However, I have some open questions:
Which attributes shall be part of all pdfs / just pdf/a and therefore likely reside in
pdfa.py
?Where should the information come from?
Currently:
EmbeddedFile/CreationDate
: manually defined when creatingAttachment
, file attribute (for local files) or current timestampDocumentMetadata.CreationDate
EmbeddedFile/ModDate
: same asCreationDate
EmbeddedFile/MimeType
: mimetypes.guess_type(url, strict=False),type
attribute should likely be preferredFilespec/AFRelationship
: manually defined when creatingAttachment
or currently'Source'
by default.Catalog/AF
: All attachments are also linked to the whole document:There is currently no option in this pull request to not include these attributes.