This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Use jinja templates to fill and sign PDF forms.

You can use this library to fill out a PDF form using data from an external source such as a database or an excel file. Use a PDF editing software to edit the form and specifiy a jinja template in the tooltip property of the form field.

Dependencies

You’ll need the pdftk library. If you want to paste images, you’ll need whatever dependencies are necessary for Pillow to load your preferred image format. Most of the packages below are taken from the Pillow documentation. You don’t need all of them. In most cases, just pdftk will do.

Ubuntu:

apt-get install python-dev python-pip libtiff5-dev libjpeg8-dev \
    zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev \
    tk8.6-dev python-tk pdftk libmagickwand-dev

OSX:

* Install pdftk (https://www.pdflabs.com/tools/pdftk-server/).
* Install dependencies for Pillow if you want to paste images.

Windows:

* Install pdftk (https://www.pdflabs.com/tools/pdftk-server/).
* Install dependencies for Pillow if you want to paste images.

Installation

You can install pdfjinja with pip:

$ pip install pdfjinja
$ pdfjinja -h

Usage:

See examples/sample.pdf for an example of a pdf file with jinja templates. The template strings are placed in the tooltip property for each form field in the pdf.

See examples/output.pdf for the output. The data that the form is filled with comes from examples/sample.json.

Basic:

$ pdfjinja -j examples/simple.json examples/sample.pdf examples/output.pdf

Attachments:

$ pdfjinja --font examples/open-sans/regular.ttf \
           --json examples/sample.json \
           examples/sample.pdf \
           examples/output.pdf

Python:

from pdfjinja import PdfJinja

pdfjinja = PdfJinja('form.pdf')
pdfout = pdfjinja(dict(firstName='Faye', lastName='Valentine'))
pdfout.write(open('filled.pdf', 'wb'))

If you are using this with Flask as a webserver:

from flask import current_app
from pdfjinja import PdfJinja
pdf = PdfJinja('form.pdf', current_app.jinja_env)
Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pdfjinja-1.0.0-py2-none-any.whl (7.2 kB) Copy SHA256 Checksum SHA256 2.7 Wheel May 3, 2016
pdfjinja-1.0.0.tar.gz (423.3 kB) Copy SHA256 Checksum SHA256 Source May 3, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting