I have a similar problem to this issue: Merging 2 pdf with Zend Framework
I cannot merge to pdf’s together using the Zend framework.
The error message:
“Undefined property: Zend_Pdf_Element_Array::$value”
My code:
$pdf2show = new Zend_Pdf();
$ex = new Zend_Pdf_Resource_Extractor();
$pdf = Zend_Pdf::load('pdf1.pdf');
$pdf2show->pages[] = $ex->clonePage($pdf->pages[0]);
$pdf = Zend_Pdf::load('pdf2.pdf');
$pdf2show->pages[] = $ex->clonePage($pdf->pages[0]);
At this point, it doesn’t matter whether I try to save the file or render the file – both will result in the same error message.
$pdf2show->save(‘merged.pdf’);
//not a matter of permissions, I gave the folder 777 while testing.
or
echo $pdf2show->render();
When rendering, I use the following headers:
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="merged.pdf"');
I get the error message when trying to either save or render.
I am currently using Zend framework version 1.11.4 and updating it to 1.11.11 makes no difference (I have tried).
I am using php 5.3.x
I have converted my PDF’s to version 1.6.
Any ideas? 🙂
I was the same problem, I solved it by converting the pdf to the cloned version 1.0 with this program: http://www.freedownloadscenter.com/Multimedia_and_Graphics/Misc__Graphics_Tools/PDF_Version_Converter_Download.html