Skip to content

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

License

Notifications You must be signed in to change notification settings

octavenz/django-puppeteer-pdf

Repository files navigation

django-puppeteer-pdf

Converts HTML to PDF

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

Forked from: django-puppeteer-pdf:v0.1.4.

Requirements

cli for puppeteer puppeteer-pdf.

Python 3.10+ are supported. See Github Actions build status for details

Note

  • 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 git+https://github.com/octavenz/django-puppeteer-pdf.git.

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',
}

License

MIT License (BSD-2-Clause). See the bundled LICENSE file for more details.

Credits

This package is a fork of pypi/django-puppeteer-pdf created by Namespace merged on top of repository created with Cookiecutter and the audreyr/cookiecutter-pypackage project template with modifications by Octave.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published