Details
Description
Zend_Pdf, 37.4.2 (http://framework.zend.com/manual/en/zend.pdf.pages.html) gives an example of cloning a page and using it as a template for other pages and then removing the template page. To remove the template page, the example code is
unset($pdf->pages[$templatePageIndex]);
I'm noticing that the documents in which I am using this technique, when opened in Adobe Acrobat, cause a warning message: "The document's page tree contains an invalid node." I suspect that the gap left in the indices of the Zend_Pdf pages[] property by removing pages in this way is causing a null, "invalid" page in the document. Perhaps it would be better for the example to use:
array_splice($pdf>pages, $templatePageIndex, 1);
I'm noticing the same behaviour also using the proposed array_splice method.