我正在使用fpdf和fpdi一起工作,这是我的第一份工作,我遇到了问题。我无法编辑pdf。这就是问题。感谢
中找不到班级
setasign\Fpdi\FpdfTpl
C:\wamp\www\Ale\fpdi\src\Fpdi.php
use setasign\Fpdi\Fpdi;
require_once('fpdf/fpdf.php');
require_once('fpdi/src/Fpdi.php');
require_once('fpdi/src/autoload.php');
// initiate FPDI
$pdf = new Fpdi();
// add a page
$pdf->AddPage();
// set the source file
$pdf->setSourceFile('documento.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at position 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx, 10, 10, 100);
// now write some text above the imported page
$pdf->SetFont('Helvetica');
$pdf->SetTextColor(255, 0, 0);
$pdf->SetXY(30, 30);
$pdf->Write(0, 'This is just a simple text');
$pdf->Output('newDoc.pdf','F');
答案 0 :(得分:0)