itspgiri / Bulk-Certificate-Generator

Let's anyone create and email as many certificates in a fraction of time with just small input to specify where to print the names, data, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bulk-Certificate-Generator

###Working as of 30th September 2021.

Let's anyone create and email as many certificates in a fraction of time with just small input to specify where to print the names, data, etc. I have writen a step-by-step process to help run this code with minimal changes in the code - as the certificate will change person to person and so will the code. It's a simple code, for anyone even without a python background to run and implement. There are two codes available:

  1. Create Certificate Only - BulkCertMaker.py - Medium Blog Here + All Steps written below as well.
  2. Create Certificate and Email - BulkCertMaker - With Email.py - Medium Blog Here

Let's you align where your text goes on the Certificate Template. Also, automatically then send the email using your specified E-Mail.

INTRODUCTION

It's a basic python program based on the Pillow Module to create bulk certificates for any event. Most softwares available online render a low quality certificate. It only requires you to make two changes

  • Update the excel sheet with your names for the Certificate.
  • Update where in the certificate should the name be printed.

PROCESS

Making it as detailed as possible so even a beginner can complete this process. Hence, if you aren't new to python just skip the steps.

  • STEP 1: Setting up IDE (Here, PyCharm is being used)
  • STEP 2: Installing the modules
  • STEP 3: Setting up your Certificate
  • STEP 4: Setting up your Excel Sheet
  • STEP 5: Setting up the position where you want the name to be printed.
  • STEP 6: Get all your certificates.

STEP 1: Setting up IDE (Here, PyCharm is being used)

You can use any IDE for running the code - I prefer PyCharm for it's UI and the in-built terminal and consoles.

STEP 2: Installing the modules

In this code, when initially runned it will result in an error if the following modules are not installed

  • Pillow
  • pandas

We use Pillow for manipulating our image, while we use pandas to access our data from the excel sheet.

pip install Pillow
pip install pandas

You can run the command in the Terminal in the folder where the file/code is. Ensure you match the case to not result in an error. If it's already installed you'll get a message like this: image You can always check your installed modules in your PyCharm IDE using: File>Settings>Project image

STEP 3: Setting up your Certificate

Ensure you add your JPG File into the folder and rename the file name in the code, to match your certificate's name. image

STEP 4: Setting up your Excel Sheet

Ensure you add your Excel File into the folder and rename the file name in the code, to match your file name. image

STEP 5: Setting up the position where you want the name to be printed.

Open your certificate image in Paint to get the pixel co-ordinates. We need 4 values, x1, x2, y1, y2. This is the text-field dimension where the name will get printed. You can later align it to left, center and right. The coordinates are on the left hand side, bottom corner. NOTE: x1, y1 is left corner while x2, y2 is the right corner. image

If it is not in pixels for you, go to the properties page of Paint and change it to pixel:

image

image

Once you have your coordinate of the file go to Line 24 of the code and add your values:

image

As you can see you can also change the values of the font size, and the font style. It will take a few tries for you to get the alignment you want. You can also change it's alignment of text here:

image

STEP 6: Get all your certificates.

Once, you are done with everything simply run the program. The code will automatically save all the certificates to the same folder as the program. image

IMAGE QUALITY

I really suggest using https://cloudconvert.com/ to convert any PDF file of the certificate template to the PNG File - It let's you control the DPI which further ensures your quality is good for the final certificate that is made.

image image

CONCLUSION

Check my medium blog for step by step guide on how to even email these certificates - Here.

Let me know if there are any other issues you face or any code improvement suggestions one may have.

About

Let's anyone create and email as many certificates in a fraction of time with just small input to specify where to print the names, data, etc.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%