Skip to content

chinapandaman/PyPDFForm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

365488e Â· Mar 23, 2025
Dec 9, 2024
Mar 23, 2025
Feb 15, 2025
Oct 31, 2021
Feb 15, 2025
Mar 23, 2025
Sep 25, 2024
Feb 28, 2025
Dec 20, 2023
Jan 20, 2024
Mar 22, 2025
Feb 5, 2025
Jun 19, 2024
Jun 19, 2024
Oct 28, 2020
Jul 10, 2024
Jun 19, 2024
Mar 4, 2025
Apr 5, 2021
Dec 25, 2024
Dec 25, 2024
Apr 6, 2023
Mar 4, 2025
Jan 20, 2024
Jul 13, 2024
Jul 11, 2024
Oct 14, 2024

Repository files navigation

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