Add /AFRelationship and /Subtype to embedded files#5
Conversation
|
There are more things missing to make the resulting files PDF/A-3 compliant. PDF/A-3 requires the https://www.loc.gov/preservation/digital/formats/fdd/fdd000360.shtml:
Also, there needs to be some specific metadata in PDF/A-3 files. But this PR is a first step with two additions that seem useful to have in any case. |
|
@jenskutilek, have you managed to achieve Attaching the XML to the PDF works like a charm. But converting the PDF into a |
|
@timokleemann, no, I didn't manage to solve this. |
|
Hi @samlown 👋, I extended this PR with the rest of the changes to make the embedding PDF/A-3 compliant: The only thing missing was creating the AF list entry that connects the files to the document. As far as I understand that is needed for every PDF/A-3. If you think it is out of scope for this gem just let me know 😎 Otherwise maybe we can get this merged and released, it is quite useful for complying with current German and French invoicing standards (Zugferd 🐴 and factur-x) |
Add AF list
I'm working towards adding XML attachments with electronic invoices to PDFs in my rails app.
Trying to validate the generated PDFs, I found out I needed two things:
/AFRelationshipentry describing the relationship of the attachment to the PDF (/Alternative,/Data,/Source,/Supplement,/Unspecified)/Subtype, e.g./text#2Fxml(representation oftext/xml; default isapplication/octet-stream)I just added those to the options:
The
mime_typestring is automatically converted to a symbol.