A Python-based tool that extracts form fields from PDFs, stores entries in a database, and generates filled PDFs with PNG conversion.
- Upload PDF templates with fillable form fields
- Extract form fields automatically from PDF documents
- Fill out forms through a web interface or command-line tool
- Store form data in a SQLite database
- Generate filled PDFs and PNG previews
- View and download completed forms
- Python 3.8 or higher
- The following Python packages:
- Flask
- Flask-SQLAlchemy
- PyPDF2
- pdfrw
- pdf2image
- reportlab
- gunicorn (for production deployment)
-
Clone this repository:
git clone https://github.com/yourusername/pdf-form-processor.git cd pdf-form-processor -
Install dependencies:
pip install -r requirements.txt -
Run the application:
python main.pyFor production environments, use gunicorn:
gunicorn --bind 0.0.0.0:5000 main:app
-
Launch the application and navigate to
http://localhost:5000in your web browser. -
Upload a PDF template:
- Click on the "Upload PDF Form Template" section
- Enter a name for your template
- Select a PDF file with fillable form fields
- Click "Upload"
-
Fill out a form:
- Select a template from the list
- Click the "Fill Form" button
- Enter data for each field
- Click "Submit and Generate PDF"
-
View and download filled forms:
- Navigate to the "Filled Forms" page
- Preview generated forms
- Download as PDF or PNG
- Delete forms when no longer needed
This repository includes a command-line tool for working with PDF forms without using the web interface.
./pdf_form_filler.sh [options] [pdf_file]
pdf_file: Path to a PDF file with form fields--list-templatesor-l: List all saved templates and fill one out--list-formsor-f: View all filled forms and their data--helpor-h: Display help information
-
Scan a new PDF and fill out the form:
./pdf_form_filler.sh example.pdfThis will:
- Scan the PDF file for form fields
- Prompt you to enter a name for the template
- Ask for values for each field
- Generate a filled PDF and PNG
- Store the form data in the database
-
List templates and fill one out:
./pdf_form_filler.sh --list-templatesThis shows all saved templates and lets you select one to fill out.
-
View previously filled forms:
./pdf_form_filler.sh --list-formsThis displays all filled forms and their data.
- Upload a PDF with fillable form fields
- Fill out the form by entering data for each field
- Submit the form to generate the filled PDF and PNG preview
- View and download the generated files
- SQLite database for storing templates, form fields, and filled forms
- Flask web framework for the web interface
- PyPDF2 and pdfrw for PDF processing
- pdf2image for PDF to PNG conversion
- Bootstrap for responsive UI
.
βββ app.py # Flask application setup
βββ main.py # Application entry point
βββ models.py # Database models
βββ pdf_processor.py # PDF processing functions
βββ pdf_form_filler.py # Command-line PDF processor script
βββ pdf_form_filler.sh # Shell wrapper for command-line tool
βββ static/ # Static assets (CSS, JS)
βββ templates/ # HTML templates
βββ README.md # This file
- Works best with standard PDF form fields
- Complex form layouts might not render perfectly in PNG previews
- Very large PDF files might take longer to process
We welcome contributions! Please see our CONTRIBUTING.md for guidelines on how to:
- Report bugs
- Suggest features
- Submit pull requests
- Set up your development environment
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Make your changes
- Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
See CONTRIBUTING.md for more details.
- Questions? Check our SUPPORT.md for help
- Discussions: Use GitHub Discussions
- Issues: Report bugs via GitHub Issues
- Code of Conduct: Please read our CODE_OF_CONDUCT.md
For security-related concerns, please see SECURITY.md for responsible disclosure guidelines.
- CHANGELOG.md - Version history and changes
- MAINTAINERS.md - Maintenance guidelines
- SUPPORT.md - Getting help and support
- SECURITY.md - Security policies
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Flask
- PDF processing powered by PyPDF2 and pdfrw
- UI framework: Bootstrap
- Thanks to all contributors and the open source community!
Made with β€οΈ by the PDF Form Filler community