Metadata-Version: 2.1
Name: django-pdf-reactor
Version: 0.1.3
Summary: PDF generator for Django, support for async generation in Django Channels worker or with Django 3.1 async views.
Home-page: https://github.com/terminalkitten/django-pdf-reactor
License: MIT
Author: TK
Author-email: dk@terminalkitten.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: Django (>=3.1,<4.0)
Requires-Dist: channels (>=2.4.0,<3.0.0)
Requires-Dist: channels-redis (>=3.0.1,<4.0.0)
Requires-Dist: django-channels-graphql-ws (>=0.7.4,<0.8.0)
Requires-Dist: nanoid (>=2.0.0,<3.0.0)
Requires-Dist: nest_asyncio (>=1.4.3,<2.0.0)
Requires-Dist: pdfmate (>=0.4.9,<0.5.0)
Requires-Dist: pdoc (>=0.3.2,<0.4.0)
Project-URL: Repository, https://github.com/terminalkitten/django-pdf-reactor
Description-Content-Type: text/markdown

[![PyPI](https://img.shields.io/pypi/v/django-pdf-reactor)](https://pypi.python.org/pypi/pdfmate)
[![PyPI version](https://img.shields.io/pypi/pyversions/django-pdf-reactor)](https://pypi.python.org/pypi/pdfmate)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

## What is Django PDF Reactor?

Use PDFGen wrapper for Pyppeteer to create PDF files in Django. Support for async generation in Django Channels worker or with Django 3.1 async views.

### Channels

More about generating PDF in channels with Websocket support.

### Async view

More about generating PDF in async view

### Stunnel Support

Chromium will not visit https://localhost:8000, so run

    brew install stunnel

Add ssl_proxy file

    pid=
    cert=/usr/local/etc/stunnel/stunnel.pem
    foreground=yes
    debug=7

    [https]
    accept=8000
    connect=8001
    TIMEOUTclose=1

Start

    sudo stunnel ssl_proxy

### Support for PDF/A

For MacOSX:

     brew install poppler ghostscript

For Ubuntu / Debian:

     apt-get install poppler ghostscript

A PDF/A document is just a PDF document that uses a specific subset of PDF that is designed to ensure it is 'self-contained'. It's not permitted to be reliant on information from external sources (e.g. font programs and hyperlinks).

From wikipedia:

Other key elements to PDF/A compatibility include:

- Audio and video content are forbidden.
- JavaScript and executable file launches are forbidden.
- All fonts must be embedded and also must be legally embeddable for
  unlimited, universal rendering. This also applies to the so-called  
  PostScript standard fonts such as Times or Helvetica.
- Colorspaces specified in a device-independent manner.
- Encryption is disallowed.
- Use of standards-based metadata is mandated.

### Is it any good?

[Yes.](http://news.ycombinator.com/item?id=3067434)

#### Credits

- [PDFGen-Python](https://pypi.org/project/pdfgen/)
- [Pyppeteer](https://pypi.org/project/pyppeteer/)

