PDFMerger.php合并PDF Stamp不显示

问题描述

我从http://pdfmerger.codeplex.com/下载了PDFMerger,并尝试了下面的示例,

<?PHP
include 'PDFMerger.PHP';

$pdf = new PDFMerger;

$pdf->addPDF('samplepdfs/one.pdf','1,3,4')
    ->addPDF('samplepdfs/two.pdf','1-2')
    ->addPDF('samplepdfs/three.pdf','all')
    ->merge('browser');

    //REPLACE 'file' WITH 'browser','download','string',or 'file' for output options
    //You do not need to give a file path for browser,string,or download - just the name.
?>

但是当我在其中一个pdf文件添加图章(https://www.foxitsoftware.com/blog/how-to-create-a-standard-stamp-for-your-pdf-files/#:~:text=Choose%20Comment%20%3E%20Stamps%20%3E%20Create%20%3E%20Create%20Custom%20Stamp.,stamp%2C%20and%20then%20click%20OK.)并尝试使用上述代码合并时,我能够合并文件,但图章丢失了

解决方法

此PDFMerger项目已经过时,并且在内部使用了FPDI。 FPDI不支持注释,因为它们不属于页面内容流。参见FAQ

我们(FPDI的作者)还提供了其他工具,使您可以:

a)Flatten these annotations,然后通过SetaPDF-Core组件使用FPDI处理文档。

b)使用SetaPDF-Merger组件来连接文档,其中包括诸如注释之类的内容。