I'musingJSpdfnowwiththemethodittakestoprintfromthescreenandthenexportsthisprinttopdf,butwhengeneratingthepdfIwouldliketomakethescreenmoreadjusted.WhenIuseLandscapeitlooksliketheimageabove,withalineinthemiddleanddoesnotfitthescreenentirely.
AndwhenIusePortraititlookslikeintheimagebeloweverythingmisaligned
SoI'dliketoknowifthere'sanythingthatcanfixthisproblem.followsthecodethatIamcurrentlyusingtoexportthescreenprinttopdf.
functiongenPDF(){html2canvas(document.body,{onrendered:function(canvas){varimg=canvas.toDataURL("image/png");
var doc = new jsPDF("l", "mm", [297, 210]);
var width = doc.internal.pageSize.width;
var height = doc.internal.pageSize.height;
doc.addImage(img , 'JPEG' ,0, 0, width, height);
doc.save('test.pdf');
}
})
}</script>