Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aprilahijriyan/pyhtmlconv
pyhtmlconv: html converter (image / pdf)
https://github.com/aprilahijriyan/pyhtmlconv
converter html image pdf python screenshot wkhtmltopdf
Last synced: 9 days ago
JSON representation
pyhtmlconv: html converter (image / pdf)
- Host: GitHub
- URL: https://github.com/aprilahijriyan/pyhtmlconv
- Owner: aprilahijriyan
- License: mit
- Created: 2019-12-31T14:30:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-13T17:52:13.000Z (almost 5 years ago)
- Last Synced: 2024-10-12T22:41:49.087Z (24 days ago)
- Topics: converter, html, image, pdf, python, screenshot, wkhtmltopdf
- Language: Python
- Homepage:
- Size: 288 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
pyhtmlconv: html converter (image / pdf)
----------------------------------------python html converter (image / pdf)
Installation
------------Anda perlu menginstall `wkhtmltopdf `_, sebelum menginstall modul ini.
.. code-block:: bash
pip install pyhtmlconv
Example
-------.. code-block:: python
import pyhtmlconv as html
url = "https://google.com"
image = html.convert_to_image(url, "jpeg")
with open("test_image.jpeg", "wb") as fp:
fp.write(image)pdf = html.convert_to_pdf(url)
with open("test_file.pdf") as fp:
fp.write(pdf)Anda juga dapat mengkonversikan data (image atau pdf) ke bentuk `data uri `_ dengan cara menambahkan nilai ``True`` pada parameter ``datauri`` di fungsi ``convert_to_image`` atau ``convert_to_pdf``.