<?php
namespace App\Service;
use App\Service\cdnManager;
use setasign\Fpdi\Tcpdf\Fpdi;
class pdfTemplate extends Fpdi
{
private $imported_template = null;
public function defaultMargins() {
$this->SetMargins(25, 35, 25, true);
$this->SetFont('freesans');
}
public function Header() {
//$this->SetMargins(25, 33, 25, true);
if($this->imported_template === null){
$cdn = new cdnManager;
$this->setSourceFile($cdn->getPath() . "/resources/assets/templates/pdfTemplate.pdf");
$this->imported_template['sec'] = $this->importPage(1);
$this->imported_template['siz'] = $this->getTemplateSize($this->imported_template['sec']);
}
$this->useTemplate($this->imported_template['sec'], 0, 0, $this->imported_template['siz']['width'], $this->imported_template['siz']['height'], false);
}
public function Footer() {
$this->SetXY(25, -15);
$this->SetFont('helvetica', 'I', 8);
//$this->SetMargins(25, 0, 25, false);
$this->Cell(0, 10, 'Puslapis / Page: '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'L', 0, '', 0, false, 'T', 'M');
$this->Cell(0, 10, 'MB Venderesas / venderes.com / info@venderes.com', 0, false, 'R', 0, '', 0, false, 'T', 'M');
}
}
?>