Skip to main content

Generate PDF from html templates and print, view or send via email

Project description

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.

Quick start

  1. Install django-sendpdf:

$ pip install django-sendpdf
  1. Install wkhtmltopdf:

  • Debian/Ubuntu:

$ 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

  1. Add “sendpdf” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
        ...
        'sendpdf',
    )
  2. 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"
  1. Include the sendpdf URLconf in your project urls.py like this:

    url(r'^sendpdf/', include('sendpdf.urls', namespace='sendpdf')),
  2. Run python manage.py runserver to see some demos:

    Template example

    View PDF inline

    Dewnload PDF

    Send PDF

Project details


Download files

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

Source Distribution

django-sendpdf-0.1.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

django_sendpdf-0.1.1-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-sendpdf-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-sendpdf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ccb615dfca763530a965f37090dff7f30cd5a9a85f6a91ef7856cf9e95eb8c1f
MD5 57cd8e9ee6424d02c3ef30c1c9115f7f
BLAKE2b-256 94cbe80fe4ac76a226ae1f8555e5c13e18927cf70f41cde537a043ced62494e9

See more details on using hashes here.

File details

Details for the file django_sendpdf-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_sendpdf-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 405e8ac9cc3ed89ade30157be7a00e28e3b5ecc6e00f9c6676ce5dd7d25582f9
MD5 9df0ccfb6b429a7cb4336ad36472d04e
BLAKE2b-256 2f2e9810183c098747424b07a219a5233c654b3a7949d7dccdeaa3bc920803da

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page