alaveteli icon indicating copy to clipboard operation
alaveteli copied to clipboard

Replace wkhtmltopdf with Ruby-based PDF generation

Open garethrees opened this issue 3 years ago • 2 comments

As an alternative to https://github.com/mysociety/alaveteli/issues/6489.

We only use wkhtmltopdf to render a PDF version of RequestController#show to include in the Zip download of a request. We create a PDF render because it's more human readable than the fallback plain text version.

We could generate this PDF using prawn or similar. We wouldn't really reduce any dependencies, but at least prawn is Ruby so is more testable and we wouldn't have to deal with the hassles of shelling out to a binary. The downside is that we'd have to maintain extra view templates so that the HTML and PDF versions are in sync, and prawn views aren't ERB so it would be quite a task to put together a similar output.

garethrees avatar Nov 10 '21 09:11 garethrees

Noting that the GitHub repos for wkhtmltopdf have all now been archived. There are packages available for AMD and ARM on Debian Bookworm, but past that we probably can't expect further builds and given the status of the project we're probably better off doing this ticket.

sagepe avatar Sep 11 '23 14:09 sagepe

https://blog.corsego.com/docraptor-html-to-pdf

garethrees avatar Dec 08 '23 15:12 garethrees