Home  >  Article  >  php教程  >  pdf document merge

pdf document merge

WBOY
WBOYOriginal
2016-08-04 08:53:352090browse
跳至 [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文件
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn