<?php
require_once('tcpdf_include.php');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->setCreator('Skills Cafe');
$pdf->setAuthor('Skills Cafe');
$pdf->setTitle('Flogames Lead Certificate');
$pdf->setSubject('Flogames Lead Certificate');
$pdf->setKeywords('flogames, skills cafe');

// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);

// set default monospaced font
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);

// set margins
$pdf->setMargins(5, PDF_MARGIN_TOP, 5);

// set auto page breaks
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
	require_once(dirname(__FILE__).'/lang/eng.php');
	$pdf->setLanguageArray($l);
}

// ---------------------------------------------------------

$pdf->setDisplayMode('fullpage', 'SinglePage', 'UseNone');

// set font
$pdf->setFont('times', 'B', 10);

$pdf->AddPage('L', 'A5');
// get the current page break margin
$bMargin = $pdf->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $pdf->getAutoPageBreak();
// disable auto-page-break
$pdf->SetAutoPageBreak(false, 0);
$pdf->SetCellPadding(0);
$tagvs = array('p' => array(0 => array('h' => 0, 'n' => 0), 1 => array('h' => 0, 'n'
=> 0)));
$pdf->setHtmlVSpace($tagvs);
$pdf->setImageScale(0.47);
$pdf->setCellHeightRatio(1.25);
$img_file = "cert-bg.jpg";
$pdf->Image($img_file, 0, 0, 210, 150, '', '', '', false, 300, '', false, false, 0);
// restore auto-page-break status
$pdf->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$pdf->setPageMark();
$html = 
'<style>
	
</style>
<div><div><p>This is to certify that <b>Abc Xyz</b> has successfully completed the Lead-Program! Participant scored a total of <b>1111/9999</b>.</p></div>';
$pdf->Image('flogames-rise-b2c.jpg', 55, 10, 75, 10, 'JPG', '', '', true, 150, '', false, false, 1, false, false, false);
$pdf->writeHTML($html, true, false, true, false, '');

//Close and output PDF document
$pdf->Output('flogames_lead_certificate.pdf', 'I');

//============================================================+
// END OF FILE
//============================================================+
