A Python-based project for generating and/or processing interactive PDF workflows using a clean input/output folder structure.
This repository is organized to keep source PDFs, processing scripts, and generated PDF outputs separated, which makes it easier to test, batch-process, and iterate on PDF automation tasks.
- Python-based PDF workflow
- Dedicated scripts folder for processing logic
- Input staging folder for source PDFs
- Output folder for generated/processed PDFs
- MIT licensed
- Includes Code of Conduct and Security Policy
interactive-pdf/
├── scripts/ # Python scripts for PDF processing / generation
├── tmp/
│ └── pdfs/ # Source/input PDFs (temporary working files)
├── output/
│ └── pdf/ # Generated/processed PDF outputs
├── LICENSE
├── CODE_OF_CONDUCT.md
└── SECURITY.md
This repo is a good foundation for tasks like:
- Creating interactive PDF forms
- Filling existing PDF forms programmatically
- Batch processing PDF files
- Converting templates into reusable form documents
- Building small PDF automation pipelines
Depending on your script implementation, “interactive PDF” may include form fields (text boxes, checkboxes, dropdowns), links, buttons, annotations, or scripted PDF actions.
-
Python 3.9+ (recommended)
-
PDF libraries (depends on your scripts), commonly:
pypdf/PyPDF2pdfrwreportlabpymupdf(fitz)fpdf2
If your repo has a requirements.txt, install with:
pip install -r requirements.txtOtherwise install the libraries used by your scripts manually, e.g.:
pip install pypdf reportlabgit clone https://github.com/kai9987kai/interactive-pdf.git
cd interactive-pdfPut the PDFs you want to process in:
tmp/pdfs/
Run your Python scripts from the scripts/ folder.
Examples (replace with your actual script names):
python scripts/main.pyor
python scripts/process_pdf.pyor batch-run all scripts one-by-one (PowerShell):
Get-ChildItem .\scripts\*.py | ForEach-Object { python $_.FullName }Processed/generated PDFs should appear in:
output/pdf/
- Drop PDF templates or source documents into
tmp/pdfs/ - Run a script from
scripts/ - Inspect generated results in
output/pdf/ - Adjust script logic (field placement, naming, values, annotations, etc.)
- Re-run until the output matches your desired interactive behavior
-
Form generation
- Add text fields, checkboxes, radio buttons, dropdowns
-
Form filling
- Populate existing PDF form fields from Python data
-
Document automation
- Generate repeatable forms/invoices/worksheets
-
Template pipelines
- Read PDFs from
tmp/pdfs/, process them, save tooutput/pdf/
- Read PDFs from
Using tmp/pdfs/ for incoming files and output/pdf/ for generated files avoids overwriting originals and makes debugging much easier.
For batch jobs, save outputs with predictable names, e.g.:
form_filled_001.pdfinvoice_2026-02-23.pdftemplate_interactive_v2.pdf
Interactive features can behave differently depending on the PDF viewer:
- Adobe Acrobat Reader
- Browser PDF viewers (Chrome/Edge)
- macOS Preview (some features may be limited)
- Confirm your script writes to
output/pdf/ - Ensure the directory exists (create it in code if needed)
- Check for path separator issues on Windows vs macOS/Linux
- Some libraries require appearance streams or field flags to be set
- Test the file in Adobe Acrobat Reader for better compatibility
- Ensure field names are unique if generating many fields
- Verify the file is inside
tmp/pdfs/ - Use absolute paths during debugging
- Print resolved paths in your script to confirm
If you want to grow this repo, consider adding:
-
requirements.txt -
READMEexamples with screenshots/GIFs -
CLI support (
argparse) for:--input--output--batch
-
Logging (
loggingmodule) -
Automated tests for PDF generation output
-
Sample PDFs in
tmp/pdfs/(or asamples/folder)
Contributions are welcome.
- Fork the repo
- Create a feature branch
- Make your changes
- Test with sample PDFs
- Open a pull request
Please read the included Code of Conduct and Security Policy before contributing.
This project is licensed under the MIT License. See LICENSE.
Kai Piper GitHub: @kai9987kai
"GitHub - kai9987kai/interactive-pdf"