Skip to main content

A Django app to generate pdfs from templates

Project description

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

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

Uploaded Source

File details

Details for the file django-xhtml2pdf-0.0.2.tar.gz.

File metadata

File hashes

Hashes for django-xhtml2pdf-0.0.2.tar.gz
Algorithm Hash digest
SHA256 29a0db37ed11eae4e4d9b2282d947ce4536f0817f7b91be12e355170ee48cf57
MD5 0c48a2936578f28b667e4ed0de312b91
BLAKE2b-256 2f4519026eb5f6edf40d518707d2b01542a03f43c7c4462763916cf3def69bc4

See more details on using hashes here.

Provenance

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