pdf 文档合并
程序员文章站
2022-04-15 21:23:20
...
跳至
[1]
[全屏预览]
$pdfDocs = array($filePath1,$filePath2); $pdfNew = new Zend_Pdf(); foreach ($pdfDocs as $file) { $pdf = Zend_Pdf::load($file); $extractor = new Zend_Pdf_Resource_Extractor(); foreach ($pdf->pages as $page) { $pdfExtract = $extractor->clonePage($page); $pdfNew->pages[] = $pdfExtract; } } $mergePdf = "mergefile.pdf"; header('content-type:application/pdf'); echo $pdfNew->render(); Zend 自带的库,好像只支持pdf1.4及以下版本pdf文件