我正在尝试将两个pdf与fpdi和fpdf合并,但是出现错误,但是我没有找到任何有关此的信息。我从https://www.setasign.com/products/fpdi/demos/concatenate-fake/获取了基本代码 我也在使用CodeIgniter。
有我的代码:
android.hardware.bluetooth@1.0-impl
我得到了这个错误:
解析错误:语法错误,意外的T_USE,在/var/www/sites/***********/public/application/third_party/fpdi/src/Fpdi.php的第27行中,预期为T_FUNCTION
该错误来自此行的Fpdi文件:
use setasign\Fpdi\Fpdi;
require_once(APPPATH. 'third_party/fpdf/fpdf.php');
require_once(APPPATH. 'third_party/fpdi/src/autoload.php');
$files = array($this->internalURL . "assets/uploadedContent/Test.pdf", $this->internalURL . "assets/uploadedContent/Test.pdf");
$pageCount = 0;
class ConcatPdf extends Fpdi
{
public $files = array();
public function setFiles($files)
{
$this->files = $files;
}
public function concat()
{
foreach($this->files AS $file) {
$pageCount = $this->setSourceFile($file);
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
$pageId = $this->ImportPage($pageNo);
$s = $this->getTemplatesize($pageId);
$this->AddPage($s['orientation'], $s);
$this->useImportedPage($pageId);
}
}
}
}
$pdf = new ConcatPdf();
$pdf->setFiles($files);
$pdf->concat();
$pdf->Output('I', './assets/uploadedContent/concat.pdf');
我不知道它是来自我还是?