0
I am using Jspdf now with the method that it takes the screen print and then exports this print to pdf , but when generating the pdf I would like to leave more adjusted the screen. When I use Landscape (Landscape) it looks like the image above , with a line in the middle and does not fit the screen entirely well.
and when I use Portrait it looks just like in the image below all misaligned
So I was wondering if you had anything that could fix this problem. follows the code I am currently using to export the screen print to pdf.
function genPDF(){
html2canvas(document.body,{
onrendered: function (canvas){
var img =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>
Can you tell if your page is responsive? Try to adjust your html to be responsive, so use bootstrap, I believe this will adjust the export.
– Carlos H
@Carlosh yes , my table and page are responsive made with bootstrap
– Lucas Ln