Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

namespace-ee/django-puppeteer-pdf

 
 

Repository files navigation

django-puppeteer-pdf

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.

About

Django Wrapper to the Chrome puppeteer to pdf

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 96.5%
  • Makefile 2.4%
  • HTML 1.1%