Online courses and training platforms often issue completion certificates: a PDF with the learner's name, course title, completion date, and sometimes a unique ID or QR code. Designing these in HTML and generating them via an API keeps your stack simple and your branding consistent. Here's how to do it with Doppio.
Why HTML + API for certificates?
Certificates need to look professional and be easy to update. With an HTML template you can:
- Use your brand fonts, colors, and logo
- Change the layout without changing code—just edit the template
- Support multiple certificate types (courses, modules, programs) with one pipeline
A PDF API renders that HTML to PDF on demand. No need to run Puppeteer or a separate service; one HTTP call per certificate (or batch with async + webhooks).
Designing the certificate template
Create a single-page HTML document with placeholders for dynamic data. Doppio templates support placeholders such as {* DOP_student_name *}, {* DOP_course_title *}, and {* DOP_completion_date *}. You can also generate the HTML in your app (Jinja2, React, etc.) and send it as base64-encoded content in the request body.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body { font-family: 'Georgia', serif; text-align: center; padding: 2cm; }
.certificate { border: 2px solid #5935dd; padding: 2rem; }
.name { font-size: 28px; margin: 1rem 0; }
.course { font-size: 18px; color: #6b6488; }
.date { font-size: 14px; margin-top: 2rem; }
</style>
</head>
<body>
<div class="certificate">
<h1>Certificate of Completion</h1>
<p class="name">{* DOP_student_name *}</p>
<p class="course">{* DOP_course_title *}</p>
<p class="date">Completed on {* DOP_completion_date *}</p>
</div>
</body>
</html>
Calling the API
When a learner completes a course, call Doppio's template sync endpoint with the template ID and templateData (or send base64-encoded HTML to the render API). You get back a document URL; you can then send that link by email, store it in your LMS, or attach it to the user's profile.
POST https://api.doppio.sh/v1/template/sync
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"templateId": "your-certificate-template-id",
"templateData": {
"DOP_student_name": "Jane Doe",
"DOP_course_title": "Introduction to CSS Paged Media",
"DOP_completion_date": "March 9, 2026"
}
}
Optional: QR codes and verification
To make certificates verifiable, add a unique ID or short URL to each certificate and render a QR code in the HTML (e.g. with a small JS library or a server-rendered image URL). Your verification page can then look up the certificate by that ID. Doppio runs the page with JavaScript enabled, so QR code generation in the template works out of the box.
Summary
Using an HTML certificate template and the Doppio API, you can issue personalized PDFs at scale for e-learning and training—without managing a headless browser. For more, see Doppio's documentation and the template feature tutorial.