Skip to main content

Django PDF views, the easy way

Project description

Latest Version Downloads License Built by

Django PDF rendering, the easy way.

Developed at en.ig.ma software shop.

Overview

This app makes rendering PDF files in Django really easy. It can be used to create invoices, bills and other documents from simple HTML markup and CSS styles. You can even embed images and use custom fonts.

The library provides both Class-Based View that is almost a drop-in replacement for Django’s TemplateView as well as helper functions to render PDFs in the backend outside the request scope (i.e. using Celery workers).

Quickstart

  1. Include django-easy-pdf and git+https://github.com/chrisglass/xhtml2pdf.git in your requirements.txt file.

  2. Add easy_pdf to INSTALLED_APPS.

  3. Create HTML template for PDF document and add a view that will render it:

    {% extends "easy_pdf/base.html" %}
    
    {% block content %}
        <div id="content">
            <h1>Hi there!</h1>
        </div>
    {% endblock %}
    
    from easy_pdf.views import PDFTemplateView
    
    class HelloPDFView(PDFTemplateView):
        template_name = "hello.html"
    

Documentation

The full documentation is at django-easy-pdf.rtfd.org.

A live demo is at easy-pdf.herokuapp.com. You can run it locally after installing dependencies by running python demo.py script from the cloned repository.

Dependencies

django-easy-pdf depends on:

  • django>=1.5.1
  • git+https://github.com/chrisglass/xhtml2pdf.git

License

django-easy-pdf is released under the MIT license.

Other Resources

Commercial Support

This app and many other help us build better software and focus on delivering quality projects faster. We would love to help you with your next project so get in touch by dropping an email at en@ig.ma.

History

0.1.0 (2014-01-24)

  • First release

Project details


Release history Release notifications

History Node

0.2.0.dev1

History Node

0.1.1

This version
History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-easy-pdf-0.1.0.zip (14.5 kB) Copy SHA256 hash SHA256 Source None Jan 25, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page