Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Django app to generate pdfs from templates
Branch: master
Pull request Compare This branch is even with iHacketh:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
django_xhtml2pdf
.gitignore
LICENSE
MANIFEST.in
README.rst
setup.py

README.rst

Django xhtml2pdf

THis project is wrapper code between the django project and the xhtml2pdf project.

What it does is simply allow people to create xhtml2pdf templates using all the cool django things like STATIC_URL etc.. (like one would for a webpage template), and the utils function makes all the images and ressources appear in the pdf.

Usage

Simply do the following:

from django_xhtml2pdf.utils import generate_pdf

def myview(response):
    resp = HttpResponse(content_type='application/pdf')
    result = generate_pdf('my_template.html', file_object=resp)
    return result
Something went wrong with that request. Please try again.