Home > php教程 > PHP源码 > pdf document merge

pdf document merge

WBOY
Release: 2016-08-04 08:53:35
Original
2147 people have browsed it
跳至 [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文件
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template