📅  最后修改于: 2022-03-11 15:01:38.783000             🧑  作者: Mango
let input = document.getElementById("divToPrint");
html2canvas(input)
.then((canvas) => {
const imgData = canvas.toDataURL('image/png');
const pdf = new jsPDF();
pdf.addImage(imgData, 'PNG', 0, 0);
pdf.save("download.pdf");
});
;