Skip to main content

Template-aware tools for filling scanned PDF forms with visual verification

Project description

pdf-form-tools

pdf-form-tools is an import-only Python package for filling layout-sensitive scanned PDF forms with deterministic placement helpers 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
  • merge the overlay back into the original PDF

Install

python -m pip install pdf-form-tools

Example

from pathlib import Path

from pdf_form_tools import Rect, merge_overlay_pdf, render_pdf_page

source_pdf = Path("form.pdf")
preview_png = Path("preview-page1.png")
render_pdf_page(source_pdf, 0, 2, preview_png)

# draw your overlay separately, then merge it back
merge_overlay_pdf(source_pdf, Path("overlay-page1.png"), Path("form-filled.pdf"))

Development

python -m pip install -e ".[dev]"
python -m ruff check .
python -m pytest
python -m build

Scope

This package contains reusable low-level helpers only. Form-specific filling flows belong in project-local scripts or thin runners, not in the shared library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf_form_tools-2.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_form_tools-2.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pdf_form_tools-2.0.0.tar.gz.

File metadata

  • Download URL: pdf_form_tools-2.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdf_form_tools-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5e05127bede72fcf2ae674e181d1badbdb2fd3272e4b339bea086d8700d85d35
MD5 b0fde00867edb135c716e32ffe20c26a
BLAKE2b-256 07e8c73a151df83f610e54a81e5aade5fe4de195153312fb7584ba7404828daf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf_form_tools-2.0.0.tar.gz:

Publisher: publish-pypi.yml on ceratops-code/pdf-form-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdf_form_tools-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pdf_form_tools-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdf_form_tools-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31076b5091c92216dde7859f3f044f62e6a1ab5363eb26c55835b22c673f9e85
MD5 159f398557d8c3ec24b65bb807efe5a9
BLAKE2b-256 c433eb717b4fe03d554eba57dcd568840e83e3c9226c68c424c20eaf4ee5e061

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf_form_tools-2.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on ceratops-code/pdf-form-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page