I have been working with the following code to put a image stamp onto a single page in a multi page pdf document. the problem i have is if i set the page to be page 5 it will not save the rest of the PDF if i make it the last page it works i want to be able to select any page in the document. below is my code
<?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');
?>