src/Service/pdfTemplate.php line 7

Open in your IDE?
  1. <?php
  2. namespace App\Service;
  3. use App\Service\cdnManager;
  4. use setasign\Fpdi\Tcpdf\Fpdi;
  5. class pdfTemplate extends Fpdi
  6. {
  7.   private $imported_template null;
  8.   public function defaultMargins() {
  9.     $this->SetMargins(253525true);
  10.     $this->SetFont('freesans');
  11.   }
  12.   public function Header() {
  13.     //$this->SetMargins(25, 33, 25, true);
  14.     if($this->imported_template === null){
  15.       $cdn = new cdnManager;
  16.       $this->setSourceFile($cdn->getPath() . "/resources/assets/templates/pdfTemplate.pdf");
  17.       $this->imported_template['sec'] = $this->importPage(1);
  18.       $this->imported_template['siz'] = $this->getTemplateSize($this->imported_template['sec']);
  19.     }
  20.     $this->useTemplate($this->imported_template['sec'], 00$this->imported_template['siz']['width'], $this->imported_template['siz']['height'], false);
  21.     
  22.   }
  23.   public function Footer() {
  24.     $this->SetXY(25, -15);
  25.     $this->SetFont('helvetica''I'8);
  26.     //$this->SetMargins(25, 0, 25, false);
  27.     $this->Cell(010'Puslapis / Page: '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0false'L'0''0false'T''M');
  28.     $this->Cell(010'MB Venderesas / venderes.com / info@venderes.com'0false'R'0''0false'T''M');
  29.   }
  30. }
  31. ?>