eKoopmans / html2pdf.js

Client-side HTML-to-PDF rendering using pure JS.
MIT License
4.13k stars 1.39k forks source link

after run pdf2html.jscontent out of shape #444

Open Alex119793898 opened 3 years ago

Alex119793898 commented 3 years ago
WeChatbeb2ef4ca720658b98827c7b78fdce91

my running code :

if(true){ var trArr = $('.process-option').find('tbody').children().toArray(); for(var k=0; k<trArr.length; k++){ trSum += trArr[k].clientHeight; if(trSum > 600){ trArr[k-1].classList.add('html2pdf__page-break'); break; } } }

var opt = { margin: [8,8,8,8], filename: getFileName(title)+'.pdf', pagebreak: { mode: ['avoid-all', 'css', 'legacy']}, image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2}, jsPDF: { unit: 'px', format: [500,600], orientation: 'portrait' } };

    html2pdf(element[0], opt);

Anyone can give me some ideas?

Alex119793898 commented 3 years ago
WeChat945d3190dbe8b0310e998d18c684eac3