function printPDF() { const element = document.querySelector('#conten').innerHTML html2pdf() .set({ margin: 10, filename: 'sample.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2 }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } }) .from(element) .save(); }
html2pdf
还没有评论,来说两句吧...