Certificates generator

In case you need a certificate generator, here it is a very simple one:

  • takes a png template with no names in it (you have to prepare it by yourself, there is an example)
  • takes the names from excel file
  • generates a certificate for each name

The code (also in this github repo):

import pandas as pd
from PIL import Image, ImageDraw, ImageFont
import os

data = pd.read_excel (r'names.xlsx') 
name_list = data["Name"].tolist() 
for i in name_list:
    im = Image.open(r'template.png')
    d = ImageDraw.Draw(im)
    location = (100, 398)
    text_color = (0, 137, 209)
    font = ImageFont.truetype("arial.ttf", 70)
    d.text(location, i, fill = text_color, font = font)
    im.save("certificato_" + i + ".pdf")
    os.startfile("certificato_" + i + ".pdf")

An example of template. The names will be printed on it.

 


Subscribe to the newsletter for updates
Tkinter templates
Avatar My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.