Skip to main content

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

Check out the GitHub repository for a live demo if you can't see it here.

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

Chicago Python User Group - Dec 14, 2023

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

pypdfform-1.4.36.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

PyPDFForm-1.4.36-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file pypdfform-1.4.36.tar.gz.

File metadata

  • Download URL: pypdfform-1.4.36.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for pypdfform-1.4.36.tar.gz
Algorithm Hash digest
SHA256 d13fc8295c42f12a4dffb60a0e5032fd8109877ee42c3eb77a61e6cdb51efc93
MD5 8a8779669a46dd877498e275f85523bc
BLAKE2b-256 d7e779710e1672420ec9d6eeab6c2eb6eeda070913f06a98ee866aab15b9aa77

See more details on using hashes here.

File details

Details for the file PyPDFForm-1.4.36-py3-none-any.whl.

File metadata

  • Download URL: PyPDFForm-1.4.36-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for PyPDFForm-1.4.36-py3-none-any.whl
Algorithm Hash digest
SHA256 c4e76bda26d08fd007ad5ae9090af220acd8baf19ff11649faa8c512f11b0224
MD5 d545ffe2ed88efb9d4b167efee8e85cb
BLAKE2b-256 71048d0c08fd881edb91364c55a2f43857587dca89963f8060a867548772adc9

See more details on using hashes here.

Supported by

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