This is the basic code, put the tcpdf code somewhere. I think there is a TCPDF plugin that makes the library available.
I added some settings into the quiz to give the certificate a title different than the name of the quiz. I hard coded a link to a PDF template for the certificate background. A lot more could be done with this but its the basic idea.
Here is the code that generates the PDF
require_once dirname(dirname(__FILE__)).'/tcpdf/tcpdf.php';
require_once dirname(dirname(__FILE__)).'/tcpdf/lib/fpdi/fpdi.php';
$pdf = new FPDI("L",'mm','LETTER', true, 'UTF-8', false);
$pagecount = $pdf->setSourceFile('certificate-background-002.pdf');
$tplidx = $pdf->importPage(1, '/MediaBox');
$pdf->AddPage();
$size = $pdf->getTemplateSize($tplidx);
$pdf->useTemplate($tplidx,0,0);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetMargins(15,0);
$pdf->SetTextColor(0,0,0);
$pdf->setFont("Times", "", 33);
$pdf->SetXY( 0, 0 );
$html = '<div><h1 style="margin:-40px 0 0 0;">Certificate of Training</h1>';
$pdf->writeHTML($html, false, false, false, false, 'C');
$pdf->setFont("Times", "", 24);
$html = '<p>'.$personName . '';
$html .= 'has successfully completed</p>';
$pdf->writeHTML($html, false, false, false, false, 'C');
$pdf->setFont("Times", "", 28);
$cert_name = $quizDetails['settings']['certificate_title'];
if (!$cert_name || empty($cert_name)) {
$cert_name = $quizDetails['name'];
}
$html = '<h3 style="margin:0;">'. $cert_name .'</h3>';
$pdf->writeHTML($html, false, false, false, false, 'C');
$pdf->setFont("Times", "", 24);
$html = '<p>on '.$datetaken. '</p></div>';
$pdf->writeHTML($html, false, false, false, false, 'C');
$pdf->setFont("Times", "", 12);
$html = '<table><tr><td width="10%"> </td><td width="30%"><img src="/images/signature3.jpg"></td><td width="10%\
"> </td><td width="40%"></td><td width="15%"> </td></tr><tr><td></td><td><hr>Signer Name</td><td></td><td><hr>'.$pd\
fTemplate.'</td><td></td></tr></table>';
$pdf->writeHTML($html, false, false, false, false, 'L');
$pdf->Output('certificate.pdf', 'I');// open in browser