【发布时间】:2014-07-14 21:11:49
【问题描述】:
我正在使用 FPDF/FPDI 获取 PDF 模板并用数据库中的数据填写它。它工作正常,除了一件事。 PDF 模板具有由最终用户填写的表单字段。问题是 PDF 模板被 FPDF/FPDI 展平,因此用户无法再填写文本字段。我想在输出的 PDF 中保留文本字段,但我不确定如何。
以下是相关代码:
include('fpdf.php'); // library for PDF generation
include('fpdi.php'); // library for using FPDF with PDF templates
$pdf =& new FPDI('L','pt', 'Letter');
$inputPDF = 'files/templates/test.pdf';
$pdf->setSourceFile($inputPDF);
...
$pdf->AddPage();
$tplidx = $pdf->ImportPage(1);
$pdf->useTemplate($tplidx);
$outputPDF='files/test.pdf';
$pdf->Output($outputPDF, 'F');
【问题讨论】: