title: jsPDF Multipage PDF - page breaking inappropriately
body: <p>I have a complex html derived from a word document which is need to converted to pdf. I converted the table into image using html2canvas, I have added that html converted image to the empty pdf using jsPDF's addImage function.Everything is working fine. But while breaking the image to multiple PDF pages its breaking inappropriately in sense a table row which has border starts in page 1 ending and ends in page 2 beginning as shown in the image below.</p>
  
  <p><a href="https://i.stack.imgur.com/5mJp0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5mJp0.png" alt="enter image description here"></a></p>
  
  <p>Tried few things but it dint worked much.Below is my code.</p>
  
  <pre><code>    var quotes = document.getElementById('totable');
      //! MAKE YOUR PDF
      var pdf = new jsPDF('p', 'pt', 'letter');
      html2canvas(quotes, {
          onrendered: function (canvas) {
  
  
  
              for (var i = 0; i &lt;= quotes.clientHeight / 980; i++) {
                  //! This is all just html2canvas stuff
                  var srcImg = canvas;
                  var sX = 0;
                  var sY = 1100 * i; // start 1100 pixels down for every new page
                  var sWidth = 900;
                  var sHeight = 1100;
                  var dX = 0;
                  var dY = 0;
                  var dWidth = 900;
                  var dHeight = 1100;
  
                  window.onePageCanvas = document.createElement("canvas");
                  onePageCanvas.setAttribute('width', 900);
                  onePageCanvas.setAttribute('height', 1100);
                  var ctx = onePageCanvas.getContext('2d');
                  // details on this usage of this function: 
                  // https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Using_images#Slicing
                  ctx.drawImage(srcImg, sX, sY, sWidth, sHeight, dX, dY, dWidth, dHeight);
  
                  // document.body.appendChild(canvas);
                  var canvasDataURL = onePageCanvas.toDataURL("image/png", 1.0);
  
                  var width = onePageCanvas.width;
                  var height = onePageCanvas.clientHeight;
  
                  //! If we're on anything other than the first page,
                  // add another page
                  if (i &gt; 0) {
                      pdf.addPage(612, 791); //8.5" x 11" in pts (in*72)
                  }
                  //! now we declare that we're working on that page
                  pdf.setPage(i + 1);
                  //! now we add content to that page!
                  pdf.addImage(canvasDataURL, 'PNG', 20, 40, (width * .62), (height * .62));
  
              }
          }
      })
  </code></pre>
  
  <p>I have created a <a href="https://plnkr.co/edit/MbQI0Y?p=preview" rel="nofollow noreferrer">plunker</a> as well. Any suggestion how to achieve proper splitting into multiple pages?</p>