Skip to content

intense123/CertLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CertLab - Your Certificate Laboratory

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.

Features

  • 🎨 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

Quick Start

Prerequisites

  • Python 3.7 or higher
  • pip (Python package installer)

Installation

  1. Clone or download this repository

  2. Install dependencies

    pip install -r requirements.txt
  3. Run the application

    python app.py
  4. Open your browser and go to http://localhost:5000

How to Use

Step 1: Prepare Your Files

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]
    

Step 2: Upload Files

  1. Go to the web application homepage
  2. Upload your PDF template by dragging and dropping or clicking "Choose PDF File"
  3. Upload your CSV data file similarly
  4. Click "Continue to Configuration"

Step 3: Configure Fields

  1. Set Name Field: Select which CSV column contains the recipient names
  2. Position the Name: Set X and Y coordinates where names should appear
  3. Add Additional Fields: Optionally add more fields like Department, Session, etc.
  4. Adjust Font Sizes: Set appropriate font sizes for different elements

Step 4: Generate and Download

  1. Click "Generate Certificates"
  2. Wait for processing to complete
  3. Download the ZIP file containing all certificates
  4. Extract and distribute your personalized certificates!

Step 5: Email Certificates (Optional)

  1. Configure Email: Go to the Email Setup page
  2. SMTP Settings: Enter your email server details (Gmail, Outlook, etc.)
  3. Compose Message: Write a personalized email body with [NAME] placeholders
  4. Send Bulk Emails: Automatically send certificates to all recipients
  5. Track Progress: Monitor real-time sending progress and handle any errors

Configuration Guide

Positioning System

  • 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)

Recommended Settings

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

Example CSV Structure

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

Technical Details

Built With

  • Backend: Flask (Python web framework)
  • PDF Processing: ReportLab, PyPDF2
  • Data Handling: Pandas
  • Frontend: Bootstrap 5, HTML5, CSS3, JavaScript
  • Icons: Font Awesome

File Structure

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)

Security Features

  • File type validation (PDF and CSV only)
  • Secure filename handling
  • File size limits (16MB max)
  • Input sanitization

Advanced Usage

Email Configuration

Gmail Setup:

  1. Enable 2-Factor Authentication in your Google Account
  2. Generate App Password (not your regular password)
  3. Use smtp.gmail.com port 587

Outlook Setup:

  1. Use your regular password
  2. Use smtp.live.com port 587

Yahoo Setup:

  1. Generate App Password in account settings
  2. Use smtp.mail.yahoo.com port 587

Email Features

  • 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

Troubleshooting

Common Issues

"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

Performance Tips

  • 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

Support

For issues, suggestions, or contributions:

  1. Check this README for solutions
  2. Verify your CSV format matches the examples
  3. Test with a small CSV file (2-3 rows) first
  4. Ensure your PDF template is not password-protected

License

This project is open source and available under the MIT License.


Happy Certificate Generating! 🎓✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published