Simple python wrapper to convert HTML to PDF with headless Chrome via selenium.
Project description
pyhtml2pdf
Simple python wrapper to convert HTML to PDF with headless Chrome via selenium.
Install
pip install pyhtml2pdf
Example
Use with website url
from pyhtml2pdf import converter
converter.convert('https://pypi.org', 'sample.pdf')
Use with html file from local machine
import os
from pyhtml2pdf import converter
path = os.path.abspath('index.html')
converter.convert(f'file:///{path}', 'sample.pdf')
Inspired the work from https://github.com/maxvst/python-selenium-chrome-html-to-pdf-converter.git
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyhtml2pdf-0.0.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for pyhtml2pdf-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d375f7f990f7a6dad8498968c6726bdef740df425298f8197d117d4d18e63e18 |
|
MD5 | 5477d8dbd4b55faa21064c225266a7aa |
|
BLAKE2b-256 | ce776cc34a05712592e12ee61d161c0114e8124603061b510460a400ad9802f0 |