Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A headless version of pdfkit which makes use of xvfb-run

Project description

The PDFKit package makes use of wkhtmltopdf, which in turn needs an X Server to run. In Debian land, this generally requires xvfb-run wrapper.

The headless_pdfkit package tries to make the hotfix proposed by jakewins a bit easier to work with.


You can install headless_pdfkit by running:

pip install headless-pdfkit


Save a simple PDF from string.:

from headless_pdfkit import generate_pdf

ret = generate_pdf('<html></html>')
with open('output.pdf', 'wb') as w:

Save a simple PDF from string while passing the –auto-servernum parameter to xvfb-run.:

options = {
    'auto_servernum': ''

ret = generate_pdf('<html></html>', options=options)
with open('output.pdf', 'wb') as w:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for headless-pdfkit, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size headless_pdfkit-0.1.5.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page