Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Stirling-PDF is is a robust, locally hosted web-based PDF manipulation tool using Docker.
python-pdfkit¶
Python wrapper for wkhtmltopdf utility to convert HTML to PDF using Webkit.
!pip install pdfkit
!sudo apt-get install wkhtmltopdfimport pdfkit
pdfkit.from_url('https://www.google.co.in/', 'shaurya.pdf')
!pip3 install weasyprint
pdf = weasyprint.HTML('http://www.google.com').write_pdf()
file('google.pdf', 'wb').write(pdf)
Selenium¶
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setCapability("download.default_directory","C:");
cap.setCapability("download.prompt_for_download","false");
cap.setCapability("directory_upgrade","true");
cap.setCapability("plugins.plugins_disabled","Chrome PDF Viewer");
WebDriver driver = new ChromeDriver(cap);
Or you can add options.AddArgument("---printing") to automatically click the print button.
https://
Sikuli¶
PyAutoGUI + WebBrowser¶
Other Solutions¶
Automate Web Page To PDF introduces a way of using PyAutoGUI to automate the convertion of web pages to PDF.