Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Creating PDF from HTML on Debian Bookworm; tools?
I am on a Debian Bookworm Docker image. My Rails6 project needs to convert HTML files to PDF. I used to do this with wkhtmltopdf, but wkhtmltopdf has not been supported for a long time now, and I want to update. I have tried using headless Chrome, but this is not a solution since it (a) contains bugs that cause parts of the HTML to be omitted, and there are one-page HTML files that even cause headless Chrome to outright crash; and (b) it's a very, very wonky installation. Right now I can't install headless Chrome on Bookworm because it can't find libasound2:amd64.
What else can I do? I tried Pandoc, but it uses an intermediate library for generating PDFs which I also find pretty wonky... pdfroff doesn't work at all and do I really need to install LaTeX?
I've been requesting my client to use a service provider such as nutrient.io, but as I generate files with confidential data, uploading our HTML files to an unknown destination isn't really something we want either.
2 answers
The following users marked this post as Works for me:
| User | Comment | Date |
|---|---|---|
| plain_toast | (no comment) | Dec 9, 2025 at 12:35 |
If you can include more CSS, there are several tools listed under https://print-css.rocks/#heading-11 which helps to get everything printed correctly.
If not, try out https://github.com/plutoprint/plutobook
0 comment threads
I originally didn't bother to mention it because I have typically used it from Pandoc, making it equivalent to LaTeX. However, Weasyprint both works as Pandoc's alternative HTML-to-PDF path and runs standalone, as weasyprint input.html output.pdf, plus assorted options if you need something more sophisticated.

2 comment threads