Atashi Dubz
Atashi Dubz

Reputation: 251

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; $h = 200/$row;

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

Upvotes: 0

Views: 5352

Answers (1)

EPB
EPB

Reputation: 4029

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

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.

As noted in the example code, you will want to disable font sub-setting if you're including form fields in your output 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.

Upvotes: 2

Related Questions