This repository contains a small Python workflow for generating named certificates from a background design and exporting a merged PDF of all generated files.
The current main flow is:
- Put recipient names in
names.csv - Use
certificate.pngas the certificate background - Run
crete.pyto generate one PDF per name ingenerated_certificates/ - Run
merge_generated_pdfs.pyto combine them into a single PDF
crete.py: Main participant certificate generator usingnames.csvandcertificate.pngmerge_generated_pdfs.py: Merges generated PDFs intoall_certificates.pdfgenerate_volunteers.py: Alternate volunteer certificate flow based on a separate template and privatevolunteers_list.pytest_fonts.py: Produces a font sample PDF for checking ReportLab built-in fontsnames.csv: CSV input file for participant namescertificate.png: Background image used for the generated certificatesgenerated_certificates/: Output folder created by the generator
- Python 3.10+
reportlabPyPDF2
Install dependencies:
pip install reportlab PyPDF2The participant generator expects a CSV file named names.csv with a Name column.
Example:
Name
John Doe
Jane Smith
Alex KumarFrom this folder, run:
python crete.pyWhat it does:
- Reads names from
names.csv - Uses
certificate.pngas a full-page background - Draws each name centered on the page
- Writes one PDF per recipient into
generated_certificates/
After generating certificates, run:
python merge_generated_pdfs.pyThis creates:
all_certificates.pdf
The merge step fails if generated_certificates/ does not exist or contains no PDFs.
The main layout settings live in crete.py:
FONT_NAMEFONT_SIZEBACKGROUND_IMAGE- The computed
xandycoordinates insidecreate_certificate()
Useful cases:
- If names appear too low or too high, adjust the
yposition - If long names overflow, reduce
FONT_SIZE - If you want a different template, replace
certificate.pngor pointBACKGROUND_IMAGEto another file
generate_volunteers.py is a separate flow intended for volunteer certificates. It currently depends on files that are not committed to the repository:
volunteers_list.py- a PDF template under
VOLUNTEERS/
Those files are ignored on purpose, so this script is only usable after you supply the required private inputs.
The repository ignores generated outputs and private inputs such as:
generated_certificates/volunteers/VOLUNTEERS/volunteers_list.py- PDF outputs
That keeps generated documents and sensitive source lists out of version control.
- If no certificates are created, check that
names.csvexists and contains aNameheader - If names do not appear in the expected place, adjust the drawing coordinates in
crete.py - If the background is missing, confirm that
certificate.pngexists in this folder - If merging fails, make sure
generated_certificates/contains valid PDF files