Generate PDF from html templates and print, view or send via email
Sendpdf is a simple Django app that can be used to generate PDF documents from html templates.
It can handle images and css very well. The generated PDF can then be displayed in the browser for printing and saving.
Alternatively, one can send the PDF to one or many email addresses.
It has been tested with Django==1.9.
Detailed documentation is in the official page.
- Install django-sendpdf:
$ pip install django-sendpdf
- Install wkhtmltopdf:
$ sudo apt-get install wkhtmltopdf
Warning! Version in debian/ubuntu repos have reduced functionality (because it compiled without the wkhtmltopdf QT patches), such as adding outlines, headers, footers, TOC etc. To use this options you should install static binary from wkhtmltopdf site or you can use this script.
- Windows and other options: check wkhtmltopdf homepage for binary installers
Add “sendpdf” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = ( ... 'sendpdf', )
In your Django settings add the location of wkhtmltopdf, default location is /usr/local/bin/wkhtmltox/bin/wkhtmltopdf, like this:
WKTHMLTOPDF_PATH = "wkhtmltopdf/path/here"
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|
(22.2 kB) Copy SHA256 Hash SHA256
|Wheel||py2.py3||Dec 14, 2016|
(19.0 kB) Copy SHA256 Hash SHA256
|Source||None||Dec 14, 2016|