I’ve got working pdf plugin, where I can write something into template file and it appears in pdf file, but I want to access mPdf function https://mpdf.github.io/reference/mpdf-functions/overview.html like addPage() and I don’t know how.
In controller:
this->autoRender = false;
Configure::write('CakePdf', [
'engine' => 'CakePdf.Mpdf',
'margin' => [
'bottom' => 15,
'left' => 15,
'right' => 15,
'top' => 15
],
'orientation' => 'portrait',
]);
$sciezka = TMP."karta.pdf";
$CakePdf = new \CakePdf\Pdf\CakePdf();
$CakePdf->template('karty',null);
$pdf = $CakePdf->write($sciezka);
My template file karty.ctp
where I want to use those functions:
<?php $this->layout = false;
?>
Test 2
<?php
$this->addPage();
?>
Page 2
but how access them? $this->addPage(); doesn’t work (undefined function).