when i want to load a pdf template i do get an error message:
Fatal error: Uncaught Error: Call to undefined method ZendPdf\PdfDocument::getPageDictionary() in /usr/local/zend/apache2/htdocs/test/vendor/zendframework/zendpdf/library/ZendPdf/PdfDocument.php:516 ....
This is my code:
$pdf = new ZendPdf\PdfDocument();
$pdf->pages[] = ($page1 = $pdf->load('public/agb.pdf'));
This code works fine:
$pdf = new ZendPdf\PdfDocument();
$pdf->pages[] = ($page1 = $pdf->newPage('A4'));
Does someone have an idea? Thanks for help.
You are trying to use \ZendPdf\Page method (getPageDictionary()) on \ZendPdf\PdfDocument object. $pdf->newPage() works fine because returns Page object.
Some code examples: Merging two pdf`s:
Adding new page to existing pdf: