The Python library for PDF forms.
Project description
Introduction
PyPDFForm is a free and open source pure-Python 3 library for PDF form processing. It contains the essential functionalities needed to interact with PDF forms:
- Inspect what data a PDF form needs to be filled with.
- Fill a PDF form by simply creating a Python dictionary.
- Create a subset of form widgets on a PDF.
It also supports other common utilities such as extracting pages and merging multiple PDFs together.
Installing
Install using pip:
pip install PyPDFForm
Quick Example
A sample PDF form can be found here. Download it and try:
from PyPDFForm import PdfWrapper
filled = PdfWrapper("sample_template.pdf").fill(
{
"test": "test_1",
"check": True,
"test_2": "test_2",
"check_2": False,
"test_3": "test_3",
"check_3": True,
},
)
with open("output.pdf", "wb+") as output:
output.write(filled.read())
After running the above code snippet you can find output.pdf
at the location you specified,
and it should look like this.
Documentation
The official documentation can be found on the GitHub page of this repository.
Other Resources
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
Built Distribution
File details
Details for the file pypdfform-1.4.37.tar.gz
.
File metadata
- Download URL: pypdfform-1.4.37.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9c48523b214c283ed11a0f1ea06f23ae6a0991a0a0bc20318a308f696878db9 |
|
MD5 | 7ece8497d05a247036e1286a46709d7a |
|
BLAKE2b-256 | cd4db82e94c40418e376aed20cfbce0198222d67482d0ef3e022d3ac8a96559c |
File details
Details for the file PyPDFForm-1.4.37-py3-none-any.whl
.
File metadata
- Download URL: PyPDFForm-1.4.37-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2385f2975483c6e2381b86c15bec6171f869bb21c6ca2ac7df6c1138075135a6 |
|
MD5 | c6c5b3f7a8046d48ca4028b15f4ab9fb |
|
BLAKE2b-256 | f08714b4d28beea608a5be54acead040df7df5e4da8f34badccd65605357fe25 |