我正在尝试从多个pdfs中删除第二个页面。当我包含行$pdf = new FPDI();
和之后的任何内容时,我会在这个页面上得到一个500个错误。通往autoload.php的道路是正确的,所以我不知道我做错了什么。
我删除了空间的数组声明。医生里没有别的东西了。
<?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>
发布于 2018-04-12 08:19:19
添加
use setasign\Fpdi\Fpdi;
到脚本的顶部并启动Fpdi
。
FPDI 2是命名空间。
在您的剪贴画中还有其他几个问题:
https://stackoverflow.com/questions/49781842
复制相似问题