Skip to main content

pyhtmlconv: html converter (image / pdf)

Project description

pyhtmlconv: html converter (image / pdf)

python html converter (image / pdf)

Installation

Anda perlu menginstall wkhtmltopdf, sebelum menginstall modul ini.

pip install pyhtmlconv

Example

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.

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

pyhtmlconv-1.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

pyhtmlconv-1.3-py2.py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page