简体   繁体   English

TCPDF。 使用TCPDF生成后是否可以使单元格可填充?

[英]TCPDF. Is it possible to make the cell fillable after generating using TCPDF?

The number of rows depends on the user input. 行数取决于用户输入。 I want to make the cell created, fillable or editable by the user. 我想让用户创建,填充或编辑单元格。 Is it possible? 可能吗? Any help would be appreciated. 任何帮助,将不胜感激。 THX. 谢谢。 for ($r=1;$r<=$row;$r++) { for ($c=1;$c<=$col;$c++) { $w = 180/2; for($ r = 1; $ r <= $ row; $ r ++){for($ c = 1; $ c <= $ col; $ c ++){$ w = 180/2; $h = 200/$row; $ h = 200 / $行;

$pdf->SetTextColor(0,0,0);
$pdf->Cell($w, $h, '', 1,0, 'C');

I'm going to assume by editable, you mean such that users may enter text into an area. 我将以可编辑的方式来假设,您的意思是用户可以在一个区域中输入文本。

In that case you should look at the TextField method. 在这种情况下,您应该查看TextField方法。 TextField 文本域

For a full example see example 014 in your examples folder or on the tcpdf.org examples page The example includes setting form properties like fill and stroke color as well. 对于一个完整的例子见例如014在您的例子文件夹或上tcpdf.org例子页的例子包括设置像填充和描边颜色窗体属性为好。

As noted in the example code, you will want to disable font sub-setting if you're including form fields in your output PDF. 如示例代码中所述,如果要在输出PDF中包括表单字段,则将要禁用字体子设置。

Basically, just have your loop create the number of text fields you want. 基本上,只需让您的循环创建所需数量的文本字段即可。

Edit: The loop should give a unique field name to each TextField . 编辑:循环应为每个TextField赋予唯一的字段名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM