AI PDF Filler is a Python application that automatically fills out PDF forms using AI-powered text generation. It detects empty fields in PDF documents and fills them with contextually appropriate responses based on provided information.
- GUI interface for easy file selection and processing
- Automated detection of empty form fields
- AI-powered text generation for filling out forms
- Support for handling multiple-cell inputs
- Question and Answer section processing
- PDF to image conversion for processing
- Converts processed images back to PDF format
Before running the application, ensure you have:
- Python 3.7 or higher installed
- Tesseract OCR installed on your system
- Download the installer from the UB-Mannheim Tesseract page
- Run the installer
- Add the Tesseract installation directory to your system PATH
- Update the Tesseract path in
testingcode.py:
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'brew install tesseractsudo apt-get install tesseract-ocr- Clone the repository:
git clone https://github.com/yourusername/ai-pdf-filler.git
cd ai-pdf-filler- Run the installation script to install required Python packages:
python install.pyThis will install the following dependencies:
- opencv-python
- numpy
- PyMuPDF
- pytesseract
- Pillow
- transformers
- torch
- setuptools
- Run the GUI application:
python gui.py- Using the GUI:
- Select your input PDF file
- Choose the context text file containing relevant information
- Select an output directory for the processed files
- Click "Start Processing" to begin
gui.py- Main GUI applicationtestingcode.py- Core processing logicinstall.py- Package installation script
- The application converts PDF pages to high-resolution images
- It detects empty form fields using image processing techniques
- For each empty field:
- Identifies the field name
- Generates appropriate text using AI
- Fills the field with the generated text
- Processes Q&A sections similarly
- Converts the processed images back to PDF format
See install.py for a complete list of Python package requirements.
- Fork the repository
- Create a new branch for your feature
- Commit your changes
- Push to the branch
- Create a new Pull Request
- Tesseract OCR for text recognition
- OpenCV for image processing
- PyMuPDF for PDF handling