title: converting html file into pdf using jspdf library
body: <p>I am trying to convert the html file to pdf using jsPDF library. But in the code I implemented, the whole image is not converting into pdf. Only half of it is visible. Could someone please tell me where am I wrong?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var canvas = document.getElementById('myCanvas');
  var context = canvas.getContext('2d');
  context.beginPath();
  context.moveTo(0,0);
  context.lineTo(200,100);
  context.closePath();
  context.strokeStyle = '#0000ff';
  context.stroke();
  
  download.addEventListener("click", function() {
    // only jpeg is supported by jsPDF
   var imgData = canvas.toDataURL("image/jpeg",1.0);              
  var pdf = new jsPDF();
   pdf.addImage(imgData, 'JPEG', 0, 0);
  
  var download = document.getElementById('download');
    pdf.save("download.pdf");
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://parall.ax/parallax/js/jspdf.js"&gt;&lt;/script&gt;
  &lt;canvas id="myCanvas" width="200" height="100" style="border:solid #0000ff;"&gt;
  &lt;/canvas&gt;
  &lt;button id="download"&gt;download&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>