I have a predefined template that was supplied by a client, it uses a lot of checkboxes and radio buttons and based on the records I need to set those fields true or false.
How do we map the field names (like name, address, city, phone etc) used in template.pdf so that can substitute the values in the array?
Does the PDFtk tool helps in doing that, when I installed it, it is command based, please shed some light?
$pdf = new FPDM('template.pdf');
$pdf->Load($fields, false); // second parameter: false if field values are in ISO-8859-1, true if UTF-8
$pdf->Merge();
$pdf->Output();
I have a predefined template that was supplied by a client, it uses a lot of checkboxes and radio buttons and based on the records I need to set those fields true or false. How do we map the field names (like name, address, city, phone etc) used in template.pdf so that can substitute the values in the array? Does the PDFtk tool helps in doing that, when I installed it, it is command based, please shed some light?
require('fpdm.php');
$fields = array( 'name' => 'My name', 'address' => 'My address', 'city' => 'My city', 'phone' => 'My phone number' );
$pdf = new FPDM('template.pdf'); $pdf->Load($fields, false); // second parameter: false if field values are in ISO-8859-1, true if UTF-8 $pdf->Merge(); $pdf->Output();