title: Make a long webpage split over multiple PDF pages via “pagesplit:true” option using jsPDF
body: <p>I have searched high and low for weeks to an answer to this but can't seem to find one that works.</p>
  
  <p>Here is the code I have:</p>
  
  <pre><code>function pdf() {
       html2canvas(document.body, {
           onrendered: function(canvas) {
             var img = canvas.toDataURL('image/jpeg')
  
             var doc = new jsPDF('p', 'pt', 'a4');
             var options = {
                 pagesplit: true
              };
             doc.addImage(img,'JPEG',0,0,&lt;?php echo "$width";?&gt;,0);
             doc.save('webpage-pdf.pdf');
             }
        });
  }
  </code></pre>
  
  <p>The code will create a PDF but it will only make 1 single PDF page.
  If the webpage is long enough it should be split over multiple PDF pages.</p>
  
  <p>This is where the pagesplit: true option comes in. But no matter how I try it the pagesplit option does nothing and it's still only produces 1 page with the rest of the website missing/cutoff from the PDF file.</p>
  
  <p>Does anyone know how to turn this option on, am I using the API correctly?</p>
  
  <p>Thanks, Paul.</p>