简体   繁体   中英

Merging multiple PDF's with Zend

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? :-)

我遇到了同样的问题,我通过使用以下程序将pdf转换为克隆的版本1.0来解决了该问题: http : //www.freedownloadscenter.com/Multimedia_and_Graphics/Misc__Graphics_Tools/PDF_Version_Converter_Download.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM