use html2pdf__page-break with multiple times. only the first one has an effect.
I found several lines of code in the source code.
// Enable page-breaks.
var pageBreaks = source.querySelectorAll('.html2pdf__page-break');
var pxPageHeight = pageSize.inner.height * pageSize.k / 72 * 96;
Array.prototype.forEach.call(pageBreaks, function (el) {
el.style.display = 'block';
var clientRect = el.getBoundingClientRect();
el.style.height = pxPageHeight - clientRect.top % pxPageHeight + 'px';
}, this);
and when clientRect.top is a decimal and pxPageHeight is a decimal, the value of el.style.height is not reliable.so I use the next code Instead.It works..
use
html2pdf__page-break
with multiple times. only the first one has an effect. I found several lines of code in the source code.and when
clientRect.top
is a decimal andpxPageHeight
is a decimal, the value ofel.style.height
is not reliable.so I use the next code Instead.It works..