Skip to content

IshanHansaka/certificate-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Certificate Generator

This project is a Python-based certificate generator that automatically creates personalized certificates for a list of participants provided in an Excel file. By using a customizable certificate template and participant data, this script can generate certificates as PDF files, which can be easily shared or printed.

Objective

The goal of this project is to automate the process of creating certificates for participants, saving time and reducing manual effort. The project reads participant names from an Excel file, formats them appropriately, and adds them to a pre-designed certificate template.

Project Structure

  • fonts/: Stores the font file used to render the participant's name on the certificate.
  • template/: Contains the certificate template image in PNG format.
  • output/: The script will save generated certificates in this directory.
  • name_list.xlsx: Excel file containing a list of participant names in a column titled "Name".
  • create.py: The main script that reads data, formats text, and generates the certificates.

Workflow

  1. Load Excel Data: The script reads names from name_list.xlsx in the "Name" column.
  2. Load Template and Fonts: A certificate template (certificate_template.png) and a custom font (CanvaSans-BoldItalic.ttf) are loaded for text rendering.
  3. Generate Certificates: For each participant:
    • The script centers the participant’s name on the template image.
    • The modified image is saved as a PDF file in the output directory.
  4. Save as PDF: Each certificate is saved with the participant's name as the filename.

Installation and Usage

Prerequisites

Ensure that you have Python installed (preferably 3.x) and the following libraries:

Install these dependencies by running:

pip install pandas pillow

Setup

  1. Clone this repository:
    git clone https://github.com/IshanHansaka/certificate-generator.git
    cd certificate-generator

Prepare Files

  • Place the certificate template image in the template/ directory.
  • Add your custom font file to the fonts/ directory.
  • Create or update name_list.xlsx in the root directory with participant names under the "Name" column.

Customization

  • Font and Color: You can modify the font_color and font_size variables in the script to adjust the appearance of the text on the certificate.
  • Template Dimensions: Update template_width and template_height in the script if your certificate template has different dimensions.
  • Text Positioning: Adjust the name_x_position and name_y_position variables or modify the y_offset in the script to control the text box's exact X and Y positions on the certificate template.

About

This repository offers a Python script to automate personalized certificate generation using participant names from an Excel file, a customizable template, and font options, producing ready-to-share PDF certificates efficiently.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages