1let page = document.getElementById("divToPrint");
2html2PDF(page, {
3 jsPDF: { unit: "pt", format: "A4", orientation: "portrait" },
4 imageType: "image/jpeg",
5 output: "./pdf/generate.pdf",
6 });
1let input = document.getElementById("divToPrint");
2
3html2canvas(input)
4 .then((canvas) => {
5 const imgData = canvas.toDataURL('image/png');
6 const pdf = new jsPDF();
7 pdf.addImage(imgData, 'PNG', 0, 0);
8 pdf.save("download.pdf");
9 });
10;