我知道以前有人问过这个问题,但我似乎找不到答案,如何添加分页符,如果转换为 pdf 我的页面会被剪切......??
html2canvas(document.getElementById("content")).then(function (canvas) {
var img = canvas.toDataURL("image/png");
var doc = new jsPDF({
orientation: "landscape",
format: "a4",
});
doc.addImage(img, "JPEG", 1, 5);
doc.save("testCanvas.pdf");
});
最佳答案
对于 PDF 转换,请改用此库,它支持分页:
关于javascript - 如何使用 jspdf 和 html2canvas 添加分页符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52943678/