I hope everyone is healthy and having a nice vacation. I am trying to create PDFs from html using using jsPDF. My framework is ReactJS. I have something like
<Container>
<div className="div1">...</div>
<div className="div2">...</div>
<div className="div3">...</div>
<div className="div4">...</div>
</Container>
the code I am using for the jsPDF is:
const generatePDF = () => {
const doc = new jsPDF({
orientation: "p",
unit: "pt",
format: "a4",
putOnlyUsedFonts: false,
});
doc.html(document.querySelector("Container"), {
callback: function (pdf) {
pdf.save(
`pdfName.pdf`
);
},
margin: [40, 40, 60, 20],
html2canvas: {
scale: 0.8,
width: 1000,
},
});
};
Is there a way to split the break the page into Page 1 upd to div with class=2 and Page 2 divs 3 and 4?