https://github.com/chinapandaman/pypdfform
:fire: The Python library for PDF forms.
https://github.com/chinapandaman/pypdfform
pdf pdf-document pdf-document-processor pdf-files pdf-forms pdf-generation pdf-merge pdf-merger pdffiller python python-3 python-library python-package python-programming python-project python3
Last synced: 8 days ago
JSON representation
:fire: The Python library for PDF forms.
- Host: GitHub
- URL: https://github.com/chinapandaman/pypdfform
- Owner: chinapandaman
- License: mit
- Created: 2020-10-28T23:47:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2026-04-18T13:59:16.000Z (about 1 month ago)
- Last Synced: 2026-04-18T15:35:03.849Z (about 1 month ago)
- Topics: pdf, pdf-document, pdf-document-processor, pdf-files, pdf-forms, pdf-generation, pdf-merge, pdf-merger, pdffiller, python, python-3, python-library, python-package, python-programming, python-project, python3
- Language: Python
- Homepage: https://chinapandaman.github.io/PyPDFForm/
- Size: 145 MB
- Stars: 1,248
- Watchers: 2
- Forks: 67
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README

PDF Form Automation Simplified - Create, Inspect, Style, and Fill Forms in Python or from the Command Line.
## Introduction
PyPDFForm is a Python library and command line tool for working with PDF forms. It provides Python APIs and CLI commands for creating, inspecting, updating, and filling forms, plus common PDF utilities.
With PyPDFForm, you can:
* Create PDF forms, form fields, and raw elements.
* Inspect form fields, metadata, and values.
* Update field styling, behavior, and scripts.
* Fill PDF forms.
* Extract pages and merge PDFs.
The goal is to make PDF form work straightforward, whether you are handling one document or building a larger workflow.
## Installing
To use PyPDFForm as a Python library, install the base package with [pip](https://pypi.org/project/PyPDFForm/):
```shell
pip install PyPDFForm
```
To use the CLI, install PyPDFForm with the `cli` extra using [pipx](https://pipx.pypa.io/stable/):
```shell
pipx install "PyPDFForm[cli]"
```
## Quick Example

The GIF above shows the CLI filling a PDF form. To try the same workflow with the Python library, download the [sample PDF form](https://chinapandaman.github.io/PyPDFForm/latest/pdfs/sample_template.pdf) and run:
```python
from PyPDFForm import PdfWrapper
filled = PdfWrapper("sample_template.pdf", need_appearances=True).fill(
{
"test": "test_1",
"check": True,
"test_2": "test_2",
"check_2": False,
"test_3": "test_3",
"check_3": True,
},
)
filled.write("output.pdf")
```
After running this snippet, `output.pdf` will be written to the location you specified and should look like [this](https://chinapandaman.github.io/PyPDFForm/latest/pdfs/sample_filled.pdf).
## Documentation
The official documentation can be found on [the GitHub page](https://chinapandaman.github.io/PyPDFForm/) of this repository.
## Other Resources
* [(WIP) Video Tutorials](https://youtube.com/playlist?list=PLNz_PBu1QA-gzYg5BvyOO98q15u5Xve1L&si=8MWasKEckBzY-NRQ)
* [Chicago Python User Group - Dec 14, 2023](https://youtu.be/8t1RdAKwr9w?si=TLgumBNXv9H8szSn)
## Star History
This project is maintained entirely in my spare time. If you like the project please consider starring the GitHub repository. It is the best way to keep me motivated and continue making the project better.
[](https://starchart.cc/chinapandaman/PyPDFForm)