Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
188
rated 0 times [  192] [ 4]  / answers: 1 / hits: 24278  / 6 Years ago, tue, october 23, 2018, 12:00:00

I know this has been asked before but I can't seem to find the answer, how to add page break, my page cut if convert to 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");
});

More From » jquery

 Answers
43

For PDF conversion, use this library instead, it supports break pages :



https://github.com/eKoopmans/html2pdf


[#53273] Thursday, October 18, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nicholas

Total Points: 188
Total Questions: 76
Total Answers: 103

Location: Honduras
Member since Sun, Dec 26, 2021
2 Years ago
nicholas questions
;