mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
389 stars 195 forks source link

Replace wkhtmltopdf with Ruby-based PDF generation #6656

Open garethrees opened 2 years ago

garethrees commented 2 years ago

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.

sagepe commented 1 year ago

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.

garethrees commented 11 months ago

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