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.

Has been tested with Django 3+. Versions prior to 2.0.0 has been tested with Django==1.9.

Detailed documentation is in the official page.

Checkout the latest code in the repo wanderijames/django-sendpdf and use docker and docker compose to test its functionality.

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 = "/usr/local/bin/wkhtmltopdf"
  1. Include the sendpdf URLconf in your project urls.py like this:

    path(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-2.0.1.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

django_sendpdf-2.0.1-py2.py3-none-any.whl (20.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: django-sendpdf-2.0.1.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.5

File hashes

Hashes for django-sendpdf-2.0.1.tar.gz
Algorithm Hash digest
SHA256 015bb95a9386165c93ec56b08b0456b3c842ae557eb6567b2efbb0ec3a223e6a
MD5 ae4f53ff787d6372eecb5a13c73822ce
BLAKE2b-256 d001d4ff706265646a22fe97cd3c5185345a13e8b559fc036f1486bb0d47cb5d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_sendpdf-2.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.5

File hashes

Hashes for django_sendpdf-2.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dd5a2dd57480196b9f56ad17710c3240b6e2d8b33d3537dfb6c4baba84fe0e26
MD5 4bb60cc16384fd338fedd6b165a022c0
BLAKE2b-256 73b67cc0fea9927b23533a21650ceb3eade16261dfd5dcface3130f5b80c8ac7

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