Skip to main content

UNKNOWN

Project description

## What is this

This is a class based mixin to download a class based view as a PDF.

The PDF is generated with firefox and selenium **(tested on ubuntu 14.04 LTS)**.

This is not really performant but generates good PDF's with selectable text.

This is how this is done:


## Example usage:
```python

class InvoiceDetail(PdfDownloadMixin, TemplateView):
template_name = "invoice_print.html"
# PDF mixin attributes
pdf_filename = 'invoice.pdf'

```

## Options:

**pdf_filename**

The filename of the PDF file download.
Default: download.pdf

**pdf_folder = '/tmp/'**

**pdf_remove_file**
Default: **python True**

**pdf_authenticate**
Default: True

**pdf_load_time**
Default: True

**pdf_get_param**
Default: 'pdf'



## Installation

```
$ pip install django-pdf-download
```
System requirements tested on (ubuntu 14.04):
```
sudo apt-get install firefox xvfb cups-pdf
```

*cups-pdf* is only used once to setup headless printing (quirk in firefox you can not save as PDF unless you printed via another printer at least once).

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

Uploaded Source

File details

Details for the file django-pdf-download-0.0.2.tar.gz.

File metadata

File hashes

Hashes for django-pdf-download-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d0c92fd2a8c5e02c89054f44fc9f857de267b3f1cd68533aba04c62a4c7af36a
MD5 26172f3800ee324858f5d3b432b7e2a7
BLAKE2b-256 1ee94051bf59f91ade14027942d0dfa2b36ba739fb2051b24d1d94b84f6916d3

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