Certificates
Issue course certificates one by one or in bulk (one name per line). Each certificate gets a number and a secret
verification code; the QR code on the certificate opens the public /verify/{code} page.
How it works
- A4 landscape page with zero margins; everything is drawn on the page canvas (
PdfContentByte): rectangles and circles for the frame and seal,showTextAligned(ALIGN_CENTER, ...)for centred text. - Long names shrink until they fit:
while (font.getWidthPoint(name, size) > maxWidth) size--; - Bulk issue = one
certificaterow per line; "Print selected" puts them in one PDF, one page each. - Verification: the QR holds
{printdoc.public-base-url}/verify/{verify_code}; the code is random, so certificate numbers cannot be guessed.
SELECT certificate_no, recipient_name, course_title, issued_on, verify_code
FROM certificate WHERE verify_code = '...';
Files: service/CertificatePdfService.java, service/BusinessService.issueCertificates, templates/verify.html.