3 ms·
A cross-platform solution is to use headless Chromium to save pages as PDFs. Example I just tried and worked for me: $ chrome.exe --headless --no-sandbox --di
by hu3 2y ago
A cross-platform solution is to use headless Chromium to save pages as PDFs.
Example I just tried and worked for me:
$ chrome.exe --headless --no-sandbox --disable-gpu --print-to-pdf=page.pdf https://news.ycombinator.com https://news.ycombinator.com
Taken from: https://circumeo.io/blog/entry/html-to-pdf-using-python-and-headless-chrome/ https://circumeo.io/blog/entry/html-to-pdf-using-python-and-...
I know you can specify cookies, existing sessions and existing profiles in case authentication is required.
- deleted 2y ago[deleted]
- jamesgeck0 2y agoThe main issue with this is that you lose text reflowing, so it's more annoying to access on mobile. You also lose interactivity; I've seen links and menus implemented with JavaScript break.
- filleduchaos 2y agoThere are also just plenty of web pages worth saving that aren't simple documents.
- hu3 2y agoIndeed. PDF is subpar for many websites. HTML is also easier to fix is something gets in the way of content.