Skip to main content

A Light Django Application which uses selenium to convert any html page to pdf. Using this approach you can easily make pdf of HTML pages with charts, tables and having their loaded Styles.

Project description

django-selenium-pdfmaker

A Light Django Application which uses selenium to convert any html page to pdf. Using this approach you can easily make pdf of HTML pages with charts, tables and having their loaded Styles.

Install

simply just using pip:

pip install django_selenium_pdfmaker

Usage

To use this module:

from django_selenium_pdfmaker.modules import PDFMaker
pdfmaker = PDFMaker()
res = pdfmaker.get_pdf_from_html(path='https://google.com', filename='output', write=True)

and res includes:

{
  "status": true,
  "raw": "pdf in binary format",
  "pdf": "ConvertedPDF instance if write flag is True.",
  "message": ""
}
  • status is true when converting to pdf is successful, else will be false. For example when url path is unreachable status will be false.
  • raw is binary data of pdf before storing in file. Will hold data if status == true
  • pdf is ConvertedPDF object if status is true.
  • message will hold reason why status is false.

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-selenium-pdfmaker-0.0.3.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

django_selenium_pdfmaker-0.0.3-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

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