Skip to main content

Django view that converts HTML to PDF using webkit.

Project description

Django view that converts HTML to PDF using webkit - via pdfkit and wkhtmltopdf.

Build Status Code Health Code Coverage Documentation Status Latest Version Supported Python versions Downloads


You need to install wkhtmltopdf.

The versions in Debian/Ubuntu repositories (installed using apt-get install wkhtmltopdf) have reduced functionality and you will most likely want to install one of the stable binaries provided at which provide increased functionality (headless, patched Qt, better rendering support).

Installation on Ubuntu is as simple as;

tar -xf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
sudo cp wkhtmltox/* /usr/


pip install django-pdfkit


Simply use the class based PDFView which is a drop in replacement for TemplateView.

from django_pdfkit import PDFView

url(r'^my-pdf/$', PDFView.as_view(template_name='my-pdf.html'), name='my-pdf'),

Then in your browser goto http://localhost:8000/my-pdf/ and it will magically render as a PDF.

See the docs for more information.


Alex Hayes <>

Download files

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

Source Distribution

django-pdfkit-0.1.0.tar.gz (888.2 kB view hashes)

Uploaded source

Built Distribution

django_pdfkit-0.1.0-py2.py3-none-any.whl (8.8 kB view hashes)

Uploaded py2 py3

Supported by

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