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 of the pre-compiled binaries on Ubuntu is as simple as;

tar -xf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
sudo cp -r 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.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_pdfkit-0.3.1-py2.py3-none-any.whl (8.8 kB) Copy SHA256 hash SHA256 Wheel py2.py3
django-pdfkit-0.3.1.tar.gz (12.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page