title: Exporting form results from Contact form 7 to PDF (fPDF)
body: <p>I am trying to export the values that users input into Contact form 7 in WordPress, to PDF via fpdf.
  This is what I've set up, I can generate a PDF but without the dynamically generated value from the form.</p>
  
  <p>functions.php</p>
  
  <pre><code>add_action( 'wpcf7_before_send_mail', 'save_application_form');
  function save_application_form($cf7) {
  
  /* GET EXTERNAL CLASSES */
  require(TEMPLATEPATH.'/fpdf/fpdf.php');
  
  $values = $cf7-&gt;posted_data;
  echo $values['first-name'];
  
  
  /* example code to generate the pdf */
  $pdf = new FPDF();
  $pdf-&gt;AddPage();
  $pdf-&gt;SetFont('Times','B',16);
  $pdf-&gt;Write(5,'first-name');
  $pdf-&gt;SetFont('Arial','B',16);
  
  
  $pdf-&gt;Output(TEMPLATEPATH.'/fpdf/pdf.pdf', 'F');
  
  /* add  the pdf as attach to the email*/
  $cf7-&gt;uploaded_files = array ( 'attachedfile' =&gt;  TEMPLATEPATH.'/fpdf/pdf.pdf' );
  </code></pre>
  
  <p>How can I pull the content from Contact form 7? 
  Now if I press send I only get a PDF with "first name" written on it. I've tried multiple combinations, nothing works.</p>
  
  <p>Thank you for your help.</p>
  
  <p>EDIT: I have figured out how to print, but it seems like the problem is, that I am not pulling the inserted content from Contact Form 7. </p>
  
  <pre><code>$first_name = $cf7-&gt;posted_data["first-name"];
  $var = "test"; 
  
  
  /* example code to generate the pdf */
  $pdf = new FPDF();
  $pdf-&gt;AddPage();
  $pdf-&gt;SetFont('Times','B',16);
  $pdf-&gt;Write(5,  "My car is " . $var . "bl");
  $pdf-&gt;SetFont('Arial','B',16);
  </code></pre>
  
  <p>So $first_name doesn't work because it is empty, any ideas how i can correct this? Because if i try with $var it works.</p>