Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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.

Comments on Creating PDF from HTML on Debian Bookworm; tools?

Post

Creating PDF from HTML on Debian Bookworm; tools?

+2
−0

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.

History

2 comment threads

Headless Chrome, pandoc (1 comment)
Linux Systems site (1 comment)
Headless Chrome, pandoc
matthewsnyder‭ wrote 10 months ago

When dismissing headless chrome and pandoc, there should be a bit more explanation. These are the two most popular tools and I'd expect them to work best.

Sounds like for chrome you've had some issues with crashes. This is suprising in that chrome is fairly mature software and its developer decides how web sites are developed. So perhaps the problem is not chrome but how you are trying to use it, and maybe that problem could be solved - ask a separate question with details of what's crashing? You can't provide the full site since it's confidential, but maybe you can provide some kind of information like error messages or an MWE.

With pandoc, you simply say "do I need to install latex" - well, yes? Latex is how the PDF is rendered. I know latex packages can be a bit large, but is ~1 GB really a problem here? Or is it that you get abstruse latex errors? You can convert to tex and render with another tool like xetex.