【发布时间】:2016-06-13 19:52:10
【问题描述】:
我一直在使用以下代码将图像标记放在多页 pdf 文档的单页上。我遇到的问题是,如果我将页面设置为第 5 页,它将不会保存 PDF 的其余部分,如果我将其设为它工作的最后一页,我希望能够选择文档中的任何页面。 下面是我的代码
<?php
require_once('fpdf/fpdf.php');
require_once('fpdi/fpdi.php');
$pdf = new FPDI();
$fullPathToPDF = 'scann/Mackay/my.pdf';
$pdf->setSourceFile($fullPathToPDF);
//echo $pageCount;
for ($i = $t; $i <= $pageCount; $i++) {
$pdf->importPage($t);
$pdf->AddPage();
$pdf->useTemplate($t);
}
//puting the stamp onto the page
$pdf->Image('Posted.png', 100, 120, 0, 0, 'png');
//save the file
$pdf->Output($fullPathToPDF, 'F');
?>
【问题讨论】: