reduce file size for savetoPDF
This commit is contained in:
parent
536e1e7a87
commit
f47c3e0007
|
|
@ -41,7 +41,7 @@ export const saveToPdf = async (editor: Editor) => {
|
||||||
reader.readAsDataURL(blob)
|
reader.readAsDataURL(blob)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Add the image to the PDF
|
// Add the image to the PDF with compression
|
||||||
pdf.addImage(
|
pdf.addImage(
|
||||||
imageData,
|
imageData,
|
||||||
"PNG",
|
"PNG",
|
||||||
|
|
@ -49,6 +49,8 @@ export const saveToPdf = async (editor: Editor) => {
|
||||||
0,
|
0,
|
||||||
selectionBounds.width,
|
selectionBounds.width,
|
||||||
selectionBounds.height,
|
selectionBounds.height,
|
||||||
|
undefined,
|
||||||
|
'FAST'
|
||||||
)
|
)
|
||||||
|
|
||||||
pdf.save("canvas-selection.pdf")
|
pdf.save("canvas-selection.pdf")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue