Notes (with certain JPG), exports oversized pdf. Github: #7314

Exporting notes (with certain JPEGs) to PDF results in oversized PDF.
This is the from github issues I have been working on.

I have tried to reproduce this issue.
The PDF is not oversized with every JPEG of those dimensions or above, but there are certain JPEGs that cause this issue of oversizing.
I have tried 2 JPEGs(4000X6000) of 6MB exported PDF is of 82MB.
I have also tried with a different JPEG( 4400X6216 ) of 5.88 MB exported PDF is of 8.89MB.

I have studied how the pdf is exported in Joplin.
If I am not wrong, it uses ElectronJS printToPDF method in its webContents module to export notes to PDF.
can any one confirm if I am right about printToPDF

I don't see any quality settings on printToPDF so there's a chance we can't do anything about it. Probably when it prints it converts the image to a lossless format like PNG and it takes more space

yup that's what I was thinking it is on ElectronJs side.
So should this issue be closed ?

You could try and use some kind of PDF parser to see what takes up the space.

1 Like