Library wrapping pdftk to fill and sign PDFs
Project description
pdf_template
Small wrapper around pdftk for filling and signing PDFs
Example:
from pdf_template import PDFTemplate, PDFTemplateSection, SignatureBoundingBox
input_data = {
"is_18_or_over": True,
"title_mr": False,
"title_ms": True,
"first_name": "Foo",
"last_name": "Bar",
"address1": "None",
"zipcode": None,
"mailto_line_1": "some address!",
}
template = PDFTemplate(
[
PDFTemplateSection(path="tests/test-input-page-1.pdf", is_form=True),
PDFTemplateSection(
path="tests/test-input-page-2-3.pdf",
is_form=True,
signature_locations={
1: SignatureBoundingBox(x=300, y=490, width=200, height=37)
},
),
PDFTemplateSection(
path="tests/test-input-page-4.pdf",
signature_locations={
1: SignatureBoundingBox(x=188, y=50, width=200, height=28)
},
),
]
)
with template.fill(
input_data, signature=Image.open("tests/sig.jpeg")
) as output_pdf:
with open("output.pdf") as out_file:
out_file.write(output_pdf.read())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pdf_template-0.0.1.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for pdf_template-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 054c8ac05fe7c6ef5955e4242c5b4f2e0de3f3e61be10363f67962158af6d0d2 |
|
MD5 | a47c6876e90adfe30639bff377d75555 |
|
BLAKE2b-256 | e37c42fcde4bf6dbfd9da79ad176a656e0a92558948153127942e910dfe7cbc4 |