title: using AJAX and Jquery to create pdf using FPDF
body: <p>I am trying to create pdf file using FPDF. </p>
  
  <p>What I right now have is an HTML page with various lines of data and a print button next to it. When someone clicks Print, I am sending corresponding data using Jquery by making AJAX call..</p>
  
  <p>This is my JQUERY code:</p>
  
  <pre><code>$('.printbtn').live('click', function(){
      var printdata = 'name=' + name_t + '&amp;address=' + address_t;        
      $.post('print.php', printdata, function(){
      });
      return false;
   });
  </code></pre>
  
  <p>this is print.php
      
  
  <pre><code> $name = $_POST['name'];
   $address = $_POST['address'];
  
   require ("fpdf17/fpdf.php");
  
   $pdf = new FPDF('P','mm',array(90,100));
  
   $pdf-&gt;AddPage();
  
   $pdf-&gt;SetFont('Arial','B',12);
  
   $pdf-&gt;Cell(0,10,'name: '.$name);
   $pdf-&gt;Cell(0,10,'address: '.$address);
  
   $pdf-&gt;Output();
  
   ?&gt;
  </code></pre>
  
  <p>But I am not getting PDF in return. Whats wrong?? In fact, nothings happening..
  I want to retreive the pdf file and send it to print</p>