This topic is: not resolved
-
Hello,
your plugin is great for my purposes, however, I am missing one particular functionality.
I would like to print some of the form data to pdf template using FPDM class (http://www.fpdf.org/en/script/script93.php), save it to the server and attach it to the Autoreply e-mail (“Confirmation”).
I have included the class in dhvc-form.php file:
require_once DHVC_FORM_DIR.'/includes/fpdm.php';
So far I am trying to produce the PDF with the form values and I have created this code. I have put it inside the submit() function in submission.php, however it doesn’t seem to work.
//create PDF $filled_data = $this->get_posted_data(); $directory = dhvc_form_upload_tmp_dir(); $form_fields = array( 'Name' => $filled_data['offname'], 'Idno' => $filled_data['idno'] . $formdata['birth'], 'Address' => $filled_data['address'] ); $pdf = new FPDM(DHVC_FORM_DIR.'/includes/template.pdf'); $pdf->Load($form_fields, true); // second parameter: false if field values are in ISO-8859-1, true if UTF-8 $pdf->Merge(); $pdf->Output($directory, doc.pdf, true); //
Could you please guide me a bit on how to connect the FPDM functionality with the DHVC Form? What am I doing wrong?
Thank you very much. I am not very experienced in programming.