pdf-form-tools
pdf-form-tools is an import-only Python package for filling layout-sensitive scanned PDF forms with deterministic placement helpers, a validated JSON recipe renderer, and visual verification primitives.
It is intentionally small:
- render PDF pages to raster images
- detect writable regions, checkbox boxes, signature lines, and ID slots
- draw text, checks, and signatures onto an overlay
- validate and render self-contained JSON form recipes
- merge the overlay back into the original PDF
Install
python -m pip install pdf-form-tools
Supported Python versions: 3.11 through 3.14.
Example
from pathlib import Path
from pdf_form_tools import merge_overlay_pdf, render_form_recipe
recipe = {
"schema": "pdf-form-tools.form-recipe.v1",
"template": {"id": "example", "version": 1},
"render": {
"page_index": 0,
"scale": 2,
"expected_size": [1191, 1684],
"page_size_cm": [21.0, 29.7],
},
"fields": {
"name": {
"value": "Emily",
"rect": [300, 500, 500, 60],
"align": "center",
"max_size": 44,
"min_size": 28,
}
},
"signatures": {},
}
source_pdf = Path("form.pdf")
overlay_png = Path("overlay-page1.png")
render_form_recipe(
source_pdf,
recipe,
Path("signatures"),
source_render_path=Path("preview-page1.png"),
overlay_path=overlay_png,
)
merge_overlay_pdf(source_pdf, overlay_png, Path("form-filled.pdf"))
Development
python -m pip install -e ".[dev]"
python scripts/validate_repository.py --build-dir "$BUILD_DIR" --evidence-file "$EVIDENCE_FILE"
See CONTRIBUTING.md for validation path requirements and the release flow.
Scope
This package owns reusable placement and generic recipe rendering. Template geometry, resolved values, profile bindings, and workflow policy remain declarative data or project-local runner concerns.
Metadata
Release files for pdf-form-tools 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdf_form_tools-2.3.0.tar.gz | 17.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdf_form_tools-2.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.5 kB
Release files / pdf_form_tools-2.3.0.tar.gz
| Download URL | pdf_form_tools-2.3.0.tar.gz |
|---|---|
| Size | 17.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a872b7ba635183b69a78775ee22c16dc83d45b2bfa68a9e672e2dec370d12749
|
|
BLAKE2b-256 checksum How to use checksums |
daaed2c01dd8f4f8fd894cd267eb44c3fd4aacf6b9252c0875fe8c1f0b0f2cda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency logRelease files / pdf_form_tools-2.3.0-py3-none-any.whl
| Download URL | pdf_form_tools-2.3.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6eae3119cbab0b71665f7ae0224e73ede3374bf3e3bc99e5388afcf4cf693135
|
|
BLAKE2b-256 checksum How to use checksums |
824f6143a5927df5ab97714b5c8411aade6f4c8471fe86ee33dfba1d1de1be7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency log