html2pdf code example
Example 1: html2pdf page break option
html2pdf().set({
pagebreak: {avoid: 'tr'}
});
Example 2: html2pdf
function generatePDF() {
// Choose the element that our invoice is rendered in.
const element = document.getElementById("invoice");
// Choose the element and save the PDF for our user.
html2pdf()
.set({ html2canvas: { scale: 4 } })
.from(element)
.save();
}