Skip to content
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

Feature Request: Add a post-processing step using exiftool to add metadata to "printed" files #171

Open
noseshimself opened this issue Aug 4, 2022 · 0 comments

Comments

@noseshimself
Copy link

noseshimself commented Aug 4, 2022

Several attempts to add metadata to the generated using the initial Grantlee templates failed as the process depends on the exact versions of libcairo and weasyprint and will not permit setting arbitrary tags or reliable set the permitted tags.

The obvious alternative is using an external tool like exiftool as last processing step. On order to permit maximum flexibility there should be a user-provided file (e. g. PDF-tags.gtmpl -- a configurable name would be a good idea, too) that will contain lines consisting of "tag name", "value" pairs which will be either fed to exiftool -tagsFromFile or as individual command line parameters to form a command like exiftool -"tag name"="value".

That way a file like

Producer, "Kraft Version 0.98"
Creator, "{{ me.organisation }}"
Author, "{{ me.NAME }}"
DocumentType, "{{` doc.docType }}"
Correspondent, "{{ customer.organisation }}"
{% if doc.projectLabel %} CorrespondentReference, "{{ doc.buyerReference }}"{% endif %}
ValidityDate, "{{ doc.dateStrISO }}"
DocumentID", "{{ doc.ident }} {{ doc.docIDStr }} {{ doc.identifier }}"
{% if doc.predecessor %}Predecessor, "{{ doc.predecessor }}"{% endif %}
{% if doc.projectLabel %}Project, "{{ doc.projectLabel }}"{% endif %}

could be used to generate the required literal values for exiftool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants