Open richeterre opened 5 years ago
I've just replaced wkhtmltopdf
with headless chromium, controlled by puppeteer (actually pyppeteer, the python version). https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions
Thought that might help!
Thank you for the suggestion! I found this, but it requires passing a URL to render to PDF: https://github.com/hassox/hpdf
Might still work if I add routes for HTML rendering and print stylesheets to my printable pages, and pass that path to the PDF generator. Then I could probably debug everything easily using Chromium.
Note to self: Check out https://hex.pm/packages/pdf
wkhtmltopdf
, which our elixir-pdf-generator dependency uses under the hood, is rather dated and based on an old version of Qt/WebKit that doesn't support Flexbox (see https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1522).Since Flexbox would make the layouting of our PDFs a lot easier, we should look out for alternative solutions with modern CSS support (or a different PDF generation approach altogether, which would have to support tables, though).