Convert form output to pdf attachment
-
I’m trying to create a pdf attachment of my CF7 form’s post data. Using the following thread I was able to get the pdf attachment working. http://wordpress.org/support/topic/convert-pdf-file
However I’m having trouble capturing the form’s post data.
Does anyone have an idea how to capture the post data?This is what I have added my functions.php file:
/* added pdf output */ add_action( 'wpcf7_before_send_mail', 'save_application_form'); function save_application_form($cf7) { /* GET EXTERNAL CLASSES */ require(TEMPLATEPATH.'/includes/fpdf.php'); /* example code to generate the pdf*/ $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('times','B',16); $pdf->Write(5,"Testing pdf output\n\n\n"); $values = $cf7->posted_data; $fname = $values['first-name']; $pdf->Write($fname); $pdf->Output(TEMPLATEPATH.'/file/pdf.pdf', 'F'); /* add the pdf as attach to the email */ $cf7->uploaded_files = array ( 'attachedfile' => TEMPLATEPATH.'/file/pdf.pdf' ); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Convert form output to pdf attachment’ is closed to new replies.