A modern web application for generating personalized certificates from PDF templates using CSV data. Perfect for workshops, courses, events, and any occasion requiring bulk certificate generation and email distribution.
- 🎨 Modern UI: Beautiful, responsive web interface with drag-and-drop file uploads
- 📄 PDF Template Support: Upload your own certificate template in PDF format
- 📊 CSV Data Integration: Automatically populate certificates with data from CSV files
- ✨ Cursive Fonts: Multiple elegant font styles including Times Italic and script fonts
- 🎯 Precise Positioning: Configure exact placement of text fields on your certificate
- 📦 Bulk Generation: Create hundreds of certificates in one go
- 💾 ZIP Download: All certificates packaged in a convenient ZIP file
- 📧 Email Integration: Automatically send certificates to recipients via email
- 📊 Real-time Progress: Live tracking of email sending progress
- 🔐 Secure Email: Support for Gmail, Outlook, Yahoo, and custom SMTP servers
- Python 3.7 or higher
- pip (Python package installer)
-
Clone or download this repository
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python app.py
-
Open your browser and go to
http://localhost:5000
PDF Template:
- Create or use an existing certificate template in PDF format
- Leave space where you want personalized text to appear
- The template should be a single page
CSV Data File:
- Must include a "Name" column for recipient names
- Can include additional columns like Department, Email, Session, etc.
- Example CSV structure:
Name,Department,Session,Email John Doe,Computer Science,2023-24,[email protected] Jane Smith,Mathematics,2023-24,[email protected]
- Go to the web application homepage
- Upload your PDF template by dragging and dropping or clicking "Choose PDF File"
- Upload your CSV data file similarly
- Click "Continue to Configuration"
- Set Name Field: Select which CSV column contains the recipient names
- Position the Name: Set X and Y coordinates where names should appear
- Add Additional Fields: Optionally add more fields like Department, Session, etc.
- Adjust Font Sizes: Set appropriate font sizes for different elements
- Click "Generate Certificates"
- Wait for processing to complete
- Download the ZIP file containing all certificates
- Extract and distribute your personalized certificates!
- Configure Email: Go to the Email Setup page
- SMTP Settings: Enter your email server details (Gmail, Outlook, etc.)
- Compose Message: Write a personalized email body with [NAME] placeholders
- Send Bulk Emails: Automatically send certificates to all recipients
- Track Progress: Monitor real-time sending progress and handle any errors
- Origin (0,0): Top-left corner of the PDF
- X-axis: Increases going right
- Y-axis: Increases going down
- Units: Points (1 inch = 72 points)
Font Sizes:
- Names: 20-30 points (large, prominent)
- Details: 12-16 points (readable)
- Dates: 10-14 points (smaller)
Common Positions (for standard certificate):
- Center Name: X=300, Y=400
- Department: X=300, Y=450
- Session/Date: X=300, Y=480
Timestamp,Name,Email,Department,Registration No,Session
2025-01-01,John Doe,[email protected],Computer Science,2023001,2023-24
2025-01-01,Jane Smith,[email protected],Mathematics,2023002,2023-24
2025-01-01,Bob Johnson,[email protected],Physics,2023003,2023-24
- Backend: Flask (Python web framework)
- PDF Processing: ReportLab, PyPDF2
- Data Handling: Pandas
- Frontend: Bootstrap 5, HTML5, CSS3, JavaScript
- Icons: Font Awesome
certificate-generator/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── README.md # This file
├── templates/ # HTML templates
│ ├── base.html # Base template
│ ├── index.html # Upload page
│ ├── configure.html # Configuration page
│ └── preview.html # Success page
├── uploads/ # Uploaded files (auto-created)
└── generated/ # Generated certificates (auto-created)
- File type validation (PDF and CSV only)
- Secure filename handling
- File size limits (16MB max)
- Input sanitization
Gmail Setup:
- Enable 2-Factor Authentication in your Google Account
- Generate App Password (not your regular password)
- Use
smtp.gmail.com
port587
Outlook Setup:
- Use your regular password
- Use
smtp.live.com
port587
Yahoo Setup:
- Generate App Password in account settings
- Use
smtp.mail.yahoo.com
port587
- Personalization: Use
[NAME]
and[CERTIFICATE]
placeholders in email body - Progress Tracking: Real-time status updates during bulk sending
- Error Handling: Detailed logs for failed emails
- Security: Passwords are not stored permanently
"No certificates generated"
- Check that your CSV has a Name column with valid data
- Ensure the selected CSV column contains names
- Verify there are no empty rows in your CSV
"Error uploading files"
- Check file formats (PDF for template, CSV for data)
- Ensure files are under 16MB
- Try renaming files to remove special characters
"Text not appearing on certificate"
- Adjust X/Y positions - text might be outside visible area
- Check font size - very large text might overflow
- Verify the coordinate system (0,0 is top-left)
"Email authentication failed"
- For Gmail, always use App Passwords, not regular passwords
- Check your email provider's SMTP settings
- Verify 2-Factor Authentication is enabled where required
- Test with a single email first before bulk sending
- For large CSV files (1000+ rows), generation may take several minutes
- Keep PDF templates simple for faster processing
- Close other applications if memory usage is high
For issues, suggestions, or contributions:
- Check this README for solutions
- Verify your CSV format matches the examples
- Test with a small CSV file (2-3 rows) first
- Ensure your PDF template is not password-protected
This project is open source and available under the MIT License.
Happy Certificate Generating! 🎓✨