0

So, i've been trying to automatically fill a bunch of certificates grabbing the names of the participants from a csv file. Im new using python so this is pretty basic. Now what i want to do is center the names in the certificates according to the size of each name contained inside the csv file while fixing the y coordinate. I´ve trying using the text.size and image.size commands but of course not properly. Any help will be welcome!

My code so far is:

import pandas as pd
import os

df = pd.read_csv('List.csv')  

font = ImageFont.truetype('Bebas.otf',230)
for index,j in df.iterrows():
    img = Image.open('CertificateModel.jpg')
    draw = ImageDraw.Draw(img)
    draw.text(xy=(1150,480),text='{}'.format(j['Names']),fill=(0,0,0),font=font)
    img.save('Images/{}.jpg'.format(j['Names'])```

0 Answers0