Convert HTML to pdf with django using nightmarejs
Project description
|nightmare\_pdf v2.0.3 on PyPi| |MIT license| |Stable|
django-nightmare-pdf
====================
Convert HTML to pdf with django using nightmare
Requirements
------------
- Python (2.7) (Need to be tested for 3.x)
- Django (1.10) (Need to be tested for previous versions)
Dependencies
------------
This django app depends on
`Nightmare <https://github.com/segmentio/nightmare>`__, you need to
first install it using ``npm``:
``npm install nightmare``
Installation
------------
Install using ``pip`` :
``pip install nightmare_pdf``
Add ``nightmare_pdf`` to your INSTALLED\_APPS setting.
::
INSTALLED_APPS = (
...
'nightmare_pdf',
)
Usage
-----
Generate a pdf from an url and save it to database, or retrieve it as a
ContentFile, or return it inside an HttpResponse :
::
from nightmare_pdf import PDFGenerator
pdf = PDFGenerator(url="https://github.com/charlesthk/django-nightmare-pdf",
# Save it to database and retrieve a PdfDoc Object (database):
pdf.save(
filename='nightmare_pdf',
title="nightmare_pdf on github",
description="Convert HTML to pdf with django using nightmare")
# Get the PDf as a Django ContentFiel :
pdf_content_file = pdf.get_content_file('nightmare_pdf')
# Return a Django HttpResponse with the PDF Attached :
return pdf.get_http_response('nightmare_pdf')
Support
-------
If you are having issues, please let us know or submit a pull request.
License
-------
The project is licensed under the MIT License.
.. |nightmare\_pdf v2.0.3 on PyPi| image:: https://img.shields.io/badge/pypi-0.0.1-green.svg
:target: https://pypi.python.org/pypi/nightmare_pdf
.. |MIT license| image:: https://img.shields.io/badge/licence-MIT-blue.svg
.. |Stable| image:: https://img.shields.io/badge/status-stable-green.svg
django-nightmare-pdf
====================
Convert HTML to pdf with django using nightmare
Requirements
------------
- Python (2.7) (Need to be tested for 3.x)
- Django (1.10) (Need to be tested for previous versions)
Dependencies
------------
This django app depends on
`Nightmare <https://github.com/segmentio/nightmare>`__, you need to
first install it using ``npm``:
``npm install nightmare``
Installation
------------
Install using ``pip`` :
``pip install nightmare_pdf``
Add ``nightmare_pdf`` to your INSTALLED\_APPS setting.
::
INSTALLED_APPS = (
...
'nightmare_pdf',
)
Usage
-----
Generate a pdf from an url and save it to database, or retrieve it as a
ContentFile, or return it inside an HttpResponse :
::
from nightmare_pdf import PDFGenerator
pdf = PDFGenerator(url="https://github.com/charlesthk/django-nightmare-pdf",
# Save it to database and retrieve a PdfDoc Object (database):
pdf.save(
filename='nightmare_pdf',
title="nightmare_pdf on github",
description="Convert HTML to pdf with django using nightmare")
# Get the PDf as a Django ContentFiel :
pdf_content_file = pdf.get_content_file('nightmare_pdf')
# Return a Django HttpResponse with the PDF Attached :
return pdf.get_http_response('nightmare_pdf')
Support
-------
If you are having issues, please let us know or submit a pull request.
License
-------
The project is licensed under the MIT License.
.. |nightmare\_pdf v2.0.3 on PyPi| image:: https://img.shields.io/badge/pypi-0.0.1-green.svg
:target: https://pypi.python.org/pypi/nightmare_pdf
.. |MIT license| image:: https://img.shields.io/badge/licence-MIT-blue.svg
.. |Stable| image:: https://img.shields.io/badge/status-stable-green.svg
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for nightmare_pdf-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97a599e9a5664152b10dbdc36864a947252a5d08f8fcb36f978ce05f94fb34bf |
|
MD5 | c7f3c30267abdc48f2000cffc0531999 |
|
BLAKE2b-256 | d7c7a7790508f8c7b354b98ab54e25eaf5df8d720f3a26c6dc26748c27f6801f |