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

Supported Python versions: 3.11 through 3.14.

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 -W error::DeprecationWarning
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.1.tar.gz (8.7 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.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdf_form_tools-2.0.1.tar.gz
  • Upload date:
  • Size: 8.7 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.1.tar.gz
Algorithm Hash digest
SHA256 412d28c97ad8ae9ed13ab255257ec1f7248f89d07bd67eccf50060423635caf3
MD5 e47a267439030517e7592798144a8e72
BLAKE2b-256 9fa5574737f76ed0260965157327f7edc83c6069e041a2c81cfa31a7579167ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf_form_tools-2.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pdf_form_tools-2.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09d2f0202a23f8d7ab0d2dc42cf2e819857777551e0336f4c70da01c213e04d1
MD5 36564e858d9d51344beef6889bdaba2b
BLAKE2b-256 1b8620b25cb4cd9bff57d4a1064bddde6d39fb13b1921466fc50fcb82b4574f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf_form_tools-2.0.1-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