A Python-based prototype that processes PDF promotional materials for spellchecking, grammar checks, and basic formatting consistency using Google's Gemini API for multimodal (text + image) analysis.
- Upload PDF promotional materials
- Analyze each page for spelling/grammar errors and formatting issues
- Review flagged issues in a web UI
- Accept or reject suggestions
- Generate a summary report
- Python 3.8 or higher
- Google Gemini API key
-
Clone this repository:
git clone <repository-url> cd pdf-promo-checker -
Install dependencies:
pip install -r requirements.txt -
Download Poppler binaries for Windows:
- Download from https://github.com/oschwartz10612/poppler-windows/releases/
- Extract the contents to the
bindirectory in the project - The application will automatically find the binaries in the correct location
- No need to add to PATH as the application will use the local binaries
Note: The application is configured to use Poppler binaries from the
bin/poppler-24.08.0/Library/bindirectory. If you download a different version, you may need to update the path inpdf_processor.py. -
Create a
.envfile in the project root with your Google Gemini API key:GOOGLE_API_KEY=your_api_key_here SECRET_KEY=your_secret_key_here
-
Start the Flask application:
python app.py -
Open your browser and navigate to
http://localhost:5000
- Upload a PDF file using the web interface
- Wait for the analysis to complete
- Review the flagged issues
- Accept or reject suggestions
- Generate a summary report
app.py: Main Flask applicationpdf_processor.py: PDF to image conversion and processinggemini_api.py: Google Gemini API integrationtemplates/: HTML templates for the web interfacestatic/: Static files (CSS, JS, images)bin/: Contains Poppler binaries for PDF processinguploads/: Temporary storage for uploaded PDFs and generated imagesreports/: Generated summary reports