Git Product home page Git Product logo

django-pdf-reactor's Introduction

PyPI PyPI version

Code style: 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.

Run demo

cd demo
make worker
make start

Read more about tunnels below

Channels

s More about generating PDF in channels with Websocket support.

Async view

More about generating PDF in async view

Ngrok Support

Chromium cannot visit https without valid certificate without a lot of steps. You should tunnnel your dev server:

ngrok http 8000

Now add ngrok url to ALLOWED_HOSTS

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.

Credits

django-pdf-reactor's People

Contributors

terminalkitten avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.