Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I just use headless chromium to "print" a generated HTML page as a PDF, works great.


My shot-scraper CLI tool has an option that can do exactly that: https://shot-scraper.datasette.io/en/stable/pdf.html

    shot-scraper pdf myfile.html -o output.pdf


AFAIK uses wkhtmltopdf underneath. Saw a post suggesting Chrome browser developers would prefer not to be offering thin cli support -- presumably for such use cases to use wkhtmltopdf directly.


It doesn't, and AFAIK they reversed that decision.


Lago actually use Gotenberg, it's very nice to manage the headless chromium state without any headache!


Did you face any implementation difficulties with your solution?


Not parent, but if you need headers and footers on each printed page you need to make use of tables.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: