▲ | pabs3 4 days ago | ||||||||||||||||
Just print to PDF in a browser, or automate that using a browser automation tool. For a non-browser-based open source solution, WeasyPrint. For a proprietary solution, try Prince XML: | |||||||||||||||||
▲ | grounder a day ago | parent | next [-] | ||||||||||||||||
WeasyPrint works really well for me. It can support all of the languages and fonts I need. I run it on AWS Lambda and in Docker as a web service. I previously used WKHTMLTOPDF, but it hasn't been supported for years and doesn't support the latest CSS, etc. It does support JS if you need it, but I'd probably look at headless Chromium or another solution for JS if needed. Edit: Previous post with some good discussion: https://news.ycombinator.com/item?id=26578826 | |||||||||||||||||
| |||||||||||||||||
▲ | rossdavidh a day ago | parent | prev | next [-] | ||||||||||||||||
+1 to weasyprint; I have used weasyprint with a django production system for a few years now, and it works well enough that I never have to think about it. I'm not doing anything fancy, though, but for me it has worked well. | |||||||||||||||||
▲ | Semaphor 7 hours ago | parent | prev | next [-] | ||||||||||||||||
I'll join the choir. We use weasyprint for ebooks and invoices and it's a joy to use. Massively new support for features over the last few years (partially thanks to some monetary sponsorships), it started pretty bare bones, and is now close to commercial solutions. The maintainers are also very responsive, and helpful. Amazing project | |||||||||||||||||
▲ | thenews a day ago | parent | prev | next [-] | ||||||||||||||||
https://stirlingpdf.io also uses weasyprint !! | |||||||||||||||||
| |||||||||||||||||
▲ | jiehong a day ago | parent | prev | next [-] | ||||||||||||||||
Most website do not have a print CSS, so it doesn’t print that nicely in PDF. But, I upvote weasyprint for that instead. | |||||||||||||||||
| |||||||||||||||||
▲ | sureglymop a day ago | parent | prev | next [-] | ||||||||||||||||
Prince XML looks nice but what about creating a PDF directly from a website? This often adds some problems, for example links still pointing to other pages on the web. But in my experience printing to PDF is often not good enough. | |||||||||||||||||
| |||||||||||||||||
▲ | rcarmo a day ago | parent | prev | next [-] | ||||||||||||||||
These two are the only right answers if you want a reliable, reproducible, relatively low resource experience. Running a browser engine has always been hard to maintain in the long run for me. | |||||||||||||||||
▲ | bluebarbet a day ago | parent | prev | next [-] | ||||||||||||||||
Seconded. In my eccentric workflow, I use Weasyprint to convert HTML emails to more portable PDFs. A surprisingly successful experiment. | |||||||||||||||||
▲ | sodimel a day ago | parent | prev | next [-] | ||||||||||||||||
+1 - Weasyprint is an excellent tool to make pdf from html content, and we're using it at work (with django) to export various documents. | |||||||||||||||||
▲ | jmyeet a day ago | parent | prev | next [-] | ||||||||||||||||
I’ve had excellent experience with Prince XML and poor experience with everything else I’ve tried. Prince is fast, robust and reliable. Yes it costs money. So does developer time. | |||||||||||||||||
| |||||||||||||||||
▲ | hulitu 18 hours ago | parent | prev [-] | ||||||||||||||||
> Just print to PDF in a browser I tried yesterday. With compliments to the moms of SWE who coded the functionality in firefox. Aparently puting the screen on a pdf page is an insurmontable task in 2025. (20 years ago was still doable). I had to make a screenshot and process the picture to print it. |