title: html2canvas and jsPDF : send generated pdf as email attachment
body: <p>I have created a function to take screenshot of current webpage and save it as PDF using html2canvas and jsPDF. Following is my code for it:</p>
  
  <pre><code>&lt;script&gt;
   function downloadpdf(){
      html2canvas(document.body,
          {
              onrendered: function(canvas){
                  var imgData = canvas.toDataURL("image/jpeg");
                  var a = document.createElement('a');
                  var doc = new jsPDF('p','mm');
                  doc.addImage(imgData, 'JPEG', 15, 40, 180, 160);
                  doc.save($.now()+'.pdf');
  
          }
      });
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>By using the above code, I am able to download the file and save it locally. 
  But I want to directly send the generated pdf by email using php script.</p>
  
  <p>Following is the code for posting image in php script where it will be sent as email:</p>
  
  <pre><code>var imgData = canvas.toDataURL("image/jpeg");
                  $.post("sendimage.php", 
                  {
                      data: imgData
                  }, function (response,status) {
                      console.log(response);
                  });
  </code></pre>
  
  <p>But how to post the generated pdf in <code>data</code> parameter?</p>
  
  <p>Kindly, recommend any solution for this. </p>