This commit is contained in:
Timothy Jaeryang Baek
2025-08-28 02:50:19 +04:00
parent 3d6605bbfd
commit 52030a241c
2 changed files with 6 additions and 6 deletions

View File

@@ -167,7 +167,7 @@
document.body.removeChild(node);
}
const imgData = canvas.toDataURL('image/png');
const imgData = canvas.toDataURL('image/jpeg', 0.7);
// A4 page settings
const pdf = new jsPDF('p', 'mm', 'a4');
@@ -179,7 +179,7 @@
let heightLeft = imgHeight;
let position = 0;
pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight);
pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight);
heightLeft -= pageHeight;
// Handle additional pages
@@ -187,7 +187,7 @@
position -= pageHeight;
pdf.addPage();
pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight);
pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight);
heightLeft -= pageHeight;
}