Skip to main content

Render any Django template to a PDF

Project description

PDF Render is a Django app that provides functions to render PDF files from Django templates.

To do so, it bundles all files required for template rendering and sends them to a separate server for processing. Using Chromium on a separate server ensures PDFs that are consistent with browser-rendered templates.

Quick start

  1. Run a pdf-render-server:

    docker run -p 3000:3000 kuboschek/pdf-render-server
  2. Add PDF_RENDER_SERVER to your settings:

    PDF_RENDER_SERVER = 'http://localhost:3000'
  3. Use the functions from ‘pdfrender’ to render PDFs in your views:

    pdfrender.render_to_bytes(template_name, context)
    pdfrender.render_to_response(template_name, context, filename=None)
    pdfrender.render_to_file(template_name, fp, context)

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_pdf_render-0.1.3.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file django_pdf_render-0.1.3.tar.gz.

File metadata

  • Download URL: django_pdf_render-0.1.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for django_pdf_render-0.1.3.tar.gz
Algorithm Hash digest
SHA256 15bfd3b7c62b0c75a92206402c2118f5306296dc9275b2f15cdc16278573aa18
MD5 e8c2189c28d121ab5487130542820699
BLAKE2b-256 3cb92aef680ad3eec0186b9b284cbc431b5a858b0bb2675a1e7245f9bee7a6a1

See more details on using hashes here.

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