Skip to content
This repository has been archived by the owner on Feb 4, 2018. It is now read-only.
/ h2p Public archive

A Python package that converts web pages to PDFs.

License

Notifications You must be signed in to change notification settings

Bogdanp/h2p

Repository files navigation

h2p

Build Status Test Coverage Maintainability

This package converts HTML pages to PDFs by leveraging libwkhtmltox via ctypes, avoiding the need to spawn subprocesses on every call.

Installation

pipenv install h2p

Usage

Make sure libwkhtmltox.0.12 is on your library path.

from h2p import generate_pdf

# PDFs are built on a background thread so each call to
# generate_pdf is asynchronous.
task = generate_pdf("output.pdf", source_uri="http://example.com")

# result blocks until a task has finished.  If an error occurred
# this will raise a ConversionError.
task.result()

See help(generate_pdf) for info on the available parameters.

License

h2p is licensed under Apache 2.0. Please see LICENSE for licensing details.

About

A Python package that converts web pages to PDFs.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages