I need to fill a pdf existing form in dynamically & used fpdm in pdf form fill in PHP.
/***************************
Sample using a PHP array
****************************/
require('fpdm.php');
$fields = array(
'EmpNo' => '1234',
'EmpName' =>'XXXX'
);
$pdf = new FPDM('EmpDetails.pdf');
$pdf->Load($fields, false); // second parameter: false if field values are in ISO-8859-1, true if UTF-8
$pdf->Merge();
$pdf->Output();
?>
Existing Pdf form template showing error:
FPDF-Merge Error: Object streams are not supported
Downloaded pdftk tool kit and convert file Showing:
FPDF-Merge Error: Number of objects (22) differs with enter code here number of xrefs (23), something , pdf xref table is corrupted :(
As found here, you need to change the 'Advanced' settings of PDFtk as following.
Note: This is only available in PDFtk Pro.
'Advanced output options:' %PDFTK% %PDFIN% output %PDFOUT%
In my installation, this was the default value.
For rooting out this menace , we also required to install pdftk server.
1- Then type the following command in cmd as: pdftk EmpDetails.pdf output fixed.pdf and issue will be fixed.
We can refer https://www.pdflabs.com/docs/pdftk-cli-examples/ for more functionalities