You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the limited knowledge I have about the code base, I tried to come up with a (high level) plan about how to "smoothly" introduce a unified/smart print_to_pdf/3 that allows to print both pdf or pdfa files.
Implementation Details
Version ChromicPDF::API
Add lib/chromic_pdf/api/v1/
Add behaviour.ex specifying its behaviour
Add impl.ex (or a better name if you can think of one) and move the code from ChromicPDF::API here.
Update ChromicPDF::API to delegate function calls to ChromicPDF::API::V1::Impl
Add V2
The goal of the second version is to have a unified/smart print_to_pdf/3, capable to print both pdf and pdfa files based on the given function parameters. This version is also smart enough to know when to use Ghoshscript.
Add lib/chromic_pdf/api/v2/
Add behaviour.ex specifying its behaviour
Add impl.ex (or a better name if you can think of one) and move the code from ChromicPDF::API here.
How should a unified print_to_pdf looks like?
The key is to have a well defined type for the opts that can be passed.
For example:
any options related to pdfa files could be passed through a archival key.
any related to annotating a the file (author, title etc), could be passed through annotations key.
and so on ...
The presence of one (or a combination) of the top level key of the opts map suffice to determine wether a pdf or
a pdfa file should be printed and wether goshscript should be used or not.
Now that we're calling Ghostscript from
print_to_pdf/2
(optionally, for multiple sources), we may as well benefit from it.GhostscriptWorker/Interface/Impl
messinfo_option
topdf_option
and add it as optional flag toprint_to_pdf/2
The text was updated successfully, but these errors were encountered: