1function genPDF() {
2
3 html2canvas(document.querySelector(".page"), {scale: "2"}).then(canvas => {
4
5 this.imgFile = canvas.toDataURL("image/jpeg", 0.3);
6 var doc = new jsPDF('p', 'mm', 'a4', true);
7 //and here is the trick, use FAST to add the canvas or any image:
8 doc.addImage(this.imgFile, "JPEG", 5, 0, 210, 297, undefined,'FAST');
9 doc.save('Test.pdf');
10
11 });
12
13}