From f47c3e00075d2066365063e8d66c8f251bc80d09 Mon Sep 17 00:00:00 2001 From: Jeff-Emmett Date: Sat, 8 Feb 2025 19:09:20 +0100 Subject: [PATCH] reduce file size for savetoPDF --- src/utils/pdfUtils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/pdfUtils.ts b/src/utils/pdfUtils.ts index 0acd0b4..6e3f393 100644 --- a/src/utils/pdfUtils.ts +++ b/src/utils/pdfUtils.ts @@ -41,7 +41,7 @@ export const saveToPdf = async (editor: Editor) => { reader.readAsDataURL(blob) }) - // Add the image to the PDF + // Add the image to the PDF with compression pdf.addImage( imageData, "PNG", @@ -49,6 +49,8 @@ export const saveToPdf = async (editor: Editor) => { 0, selectionBounds.width, selectionBounds.height, + undefined, + 'FAST' ) pdf.save("canvas-selection.pdf")