I'm trying to remove the second page from multiple pdfs. I get a 500 error on this page when I include the line $pdf = new FPDI();
and anything afterwards. The path to the autoload.php is right, so I do not know what I am doing wrong.
I cut out array declarations for space. There is nothing else in the doc other than that.
<?php
require_once('includes/fpdi/autoload.php');
ini_set('memory_limit', '1024M');
ini_set('max_execution_time', 120); //
$i = 0;
foreach ($arrFiles as &$value) {
$destination=fopen($documentroot."attachments/".$FileNames[$i],"w");
$remote = $arrFiles[$i];
$local = $documentroot."attachments/".$FileNames[$i];
copy($remote, $local);
fclose($destination);
$pdf = new FPDI();
// $pageCount = $pdf->setSourceFile($documentroot."attachments/".$FileNames[$i]);
//$templateID = $pdf->importPage(1);
//$pdf->getTemplateSize($templateID);
//$pdf->addPage();
//$pdf->useTemplate($templateID);
// $pdf->Output();
}
?>
<html>
<head>
<title></title>
</head>
<body>
Hello
</body>
</html>