<?php
// Include the main TCPDF library (search for installation path).
if (file_exists('/var/www/html/smarttraveldoc/mpdf60/mpdf.php')){
//require_once('/var/www/html/smarttraveldoc/tcpdf/config/lang/eng.php');
require_once('/var/www/html/smarttraveldoc/mpdf60/mpdf.php');
}
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends mPDF {
public function Header($content = '') {
$this->SetHTMLHeader('
<p style="text-align: right;
font-size: 11px;
font-family:Helvetica;
margin-right:3px;
border:none !important;">
Page {PAGENO}/{nb}
</p>
','BLANK',true);
}
// Page footer
public function Footer() {
$this->SetHTMLFooter('
<p style="text-align: right;
font-size: 50px;
position:absolute;
bottom:10px;
font-family:Arial;
margin-right:3px;
border:none !important;">
Page {PAGENO}/{nb}
</p>
','BLANK');
// Reseller data
$this->SetY(-13);
$this->SetFont('Helvetica', 'N', 8);
$this->WriteCell(0, 10, $resName.' - '.$resAddress.' - Tel: '.$resPhone, 0, false, 'C', 0, '', 0, false, 'T', 'M');
$this->SetY(-10);
$this->SetFont('Helvetica', 'N', 8);
$this->WriteCell(0, 10, 'Fax: '.$resFax.' CIF '.$resCIF.' - G.C. 279MD'.$resWeb, 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
// create new PDF document
$pdf = new MYPDF('UTF-8', 'A4', 0, 'Helvetica',10,10,16,20,9,9,'P');
//set auto page breaks
$pdf->autoPageBreak = true;
$pdf->AliasNbPages();
$pdf->AliasNbPageGroups();
$pdf->use_kwt = true;
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 051');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
$pdf->AddPage();
$pdf->AddPage();
$pdf->AddPage();
//Close and output PDF document
$pdf->Output('example_051.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
?>