'z2z' ]; // ////var_dump( $ffdf->forge_fdf( $pdf_form_url, $fdf_data_strings, $fdf_data_names, $fields_hidden, $fields_readonly ) ); //file_put_contents( '941.fdf', $ffdf->forge_fdf( $pdf_form_url, $fdf_data_strings, [], [], [] ) ); //Alternative method, but still doesn't work with IRS PDFs. require_once( '../../../../fpdm/fpdm.php' ); $fields = array( 'f1_1[0]' => '12', 'f1_2[0]' => '34567', //'f1_3[0]' => '3', //'f1_4[0]' => '4', //'f1_5[0]' => 'f1_5', //'f1_6[0]' => 'f1_6', //'f1_7[0]' => 'f1_7', //'f1_8[0]' => 'f1_8', //'f1_9[0]' => 'f1_9', //'f1_10[0]' => 'f1_10', //'april_cb' => true, 'c1_1[1]' => true, 'c1_1[2]' => true, //'f1_13[0]' => '1234', //'f1_14[0]' => '99', ); $pdf = new FPDM('f941b.pdf'); $pdf->useCheckboxParser = true; //IMPORTANT: This must be enabled. //$pdf->verbose = true; //$pdf->verbose_level = 1; $pdf->Load($fields, false); // second parameter: false if field values are in ISO-8859-1, true if UTF-8 $pdf->Merge(); //$data = $pdf->Output( '/tmp/', 'test.pdf' ); $data = $pdf->Output( 'S' ); file_put_contents('test.pdf', $data ); ?>