ZF-11328: Cloning of Zend_Pdf_Pages does not work as described in documentation and as expected


Cloning a PDF page does not work as expected or documented. When trying to make a working example out of […] it throws an exception {{Uncaught exception 'Zend_Pdf_Exception' with message 'Font has not been set'}} event if the original page has a font set which should be cloned, too.

$templatePageIndex = 'template';
$pdf = new Zend_Pdf();
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4_LANDSCAPE);
$page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 11);
$pdf->pages[$templatePageIndex] = $page;
$template = $pdf->pages[$templatePageIndex];
$page1 = new Zend_Pdf_Page($template);
$page1->drawText('Some text...', 10, 10);


No comments to display