Skip to content
This repository has been archived by the owner. It is now read-only.
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
h2p
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Packages

No packages published

Languages