Skip to main content

Source Code: https://github.com/diafygi/pdfformfiller

Documentation: https://pdfformfiller.readthedocs.org/

This is a library that lets you easy insert text into a pdf. It is super useful when you need to prefill an existing pdf template (for example, a grant application form) with your own data.

pip install pdfformfiller

Once installed, you can add text fields to any pdf. You specify the bounding box of the field, and the text will auto-resize to fit within that rectangle.

from pdfformfiller import PdfFormFiller
filler = PdfFormFiller("myform.pdf")
filler.add_text(text, pagenum, (x1, y1), (x2, y2))
filler.write(outfile)

In order to determine the correct (x1, y1), (x2, y2) coordinates for your test field bounding box, we recommend dumping your existing pdf template to images with 72 dpi and using an image editor (like GIMP) to find the pixel coordinates of the rectangle you want your bounding box to be.

pdftoppm -png -r 72 myform.pdf myform-pages

Metadata

Release files for PdfFormFiller 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PdfFormFiller 0.4
File Size Uploaded
PdfFormFiller-0.4.tar.gz 4.4 kB Details

Release files / PdfFormFiller-0.4.tar.gz

Download URL PdfFormFiller-0.4.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d0da7e3abee4144035e68de3baadf8ba1edf243f064f63f449abd3a8394c75d3
BLAKE2b-256 checksum
How to use checksums
5c6d3a2f5d9d0f65130075c778d0f88e6cfdeef432fe864f2c1fb41423279dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page