Skip to main content

Converts HTML to PDF using puppeteer.

Project description

Latest version Travis-CI Documentation Status Number of PyPI downloads on a month

Converts HTML to PDF

Provides Django views to wrap the HTML to PDF conversion using puppeteer.

Forked from: django-wkhtmltopdf.

Requirements

cli for puppeteer puppeteer-pdf.

Python 2.6+ and 3.3+ are supported. See travis-ci build status for details

Note

  • Current version is only tested as a use of django rest framework renderer examples/drf_renderer.py

  • Documentation is not up to date but you can see working use cases in examples directory

  • Reporting bugs and issues is welcomed

Installation

Run pip install django-puppeteer-pdf.

By default it will execute the first puppeteer-pdf command found on your PATH.

It is recommended to specify full path of puppeteer-pdf using one of the way mentioned below.

If you can’t add puppeteer-pdf to your PATH, you can set PUPPETEER_PDF_CMD to a specific executable:

e.g. in settings.py:

PUPPETEER_PDF_CMD = '/path/to/my/puppeteer-pdf'

or alternatively as env variable:

export PUPPETEER_PDF_CMD=/path/to/my/puppeteer-pdf

You may also set PUPPETEER_PDF_CMD_OPTIONS in settings.py to a dictionary of default command-line options.

The default is:

PUPPETEER_PDF_CMD_OPTIONS = {
    'format': 'A4',
}

Documentation

Documentation is available at http://django-puppeteer-pdf.readthedocs.org/en/latest/.

License

MIT licensed. See the bundled LICENSE file for more details.

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-puppeteer-pdf-0.1.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

django_puppeteer_pdf-0.1.4-py2.py3-none-any.whl (14.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-puppeteer-pdf-0.1.4.tar.gz.

File metadata

  • Download URL: django-puppeteer-pdf-0.1.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for django-puppeteer-pdf-0.1.4.tar.gz
Algorithm Hash digest
SHA256 12177f078a574e8e3390a7a2cb021256690d9973d145cec8306ec13e251ce44e
MD5 d9824acd4b541eb7f88b6130f97e8a21
BLAKE2b-256 6adc47d015b136fb139662cb733ef19b37fda9c3557e91b3b535a13af46f2313

See more details on using hashes here.

File details

Details for the file django_puppeteer_pdf-0.1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: django_puppeteer_pdf-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for django_puppeteer_pdf-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 81c5e6304398096755f3469382b1e2c843779d4239d1764c0f004b4064620a6c
MD5 184772f842e885568f2512faddb52773
BLAKE2b-256 b25ad9e37b7ba3cdd0d0bd74a8afacb52c4418415b53685c86a6fb8615658f16

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