Forum How do I...?

Reduce PDF file size (with a lot of jpeg images)

ThomasFR
Hello,

We successfully created PDF files, but thoses are quite huge due to a lot of hi-res jpeg images in it. For exemple, a 30 pages PDF is around 225Mb, if I use the optimization tool from Adobe Acrobat Pro (setting jpg image to max 300dpi) reduce the file to 23Mb !

Is there any way to do it with Prince ? Because we have a lot a files and we can't optimize them manually with this method.

Original file : https://www.ondonnedesnouvelles.com/30pages.pdf

Optimized file : https://www.ondonnedesnouvelles.com/30pages_optimized.pdf

Thanks for your help !
mikeday
Prince can reduce JPEG quality with "prince-image-magic: jpeg-quality(50%)" but that is not really what you want, you actually want to scale down the image, which Prince cannot do at the moment.

By the way, what resolution are the original images, if scaling it down is still 300dpi?

You could use a scriptable command-line tool such as ImageMagick to reduce the resolution of the images before running Prince.
ThomasFR
Thansk for the quick answer !

Hmm reducing jpeg quality as you say is not what we want, we have to scale down images.

The jpg we use are sent by our users and can be various resolutions, in our exemple, there are files that are 4608x3456. They can be use in full A5, but also in small boxes in A5, so the dpi may vary a lot.

Using ImageMagick can be a solution but we have a huge amount of jpeg files (millions) and as they can be use in a multiple sizes in our pdf documents it's not really a performance solution ...

Is there a tool like the one in Adobe Acrobat Pro that we can use on a linux plateform in command line ?
mikeday
There are many tools if you search for "pdf optimizer command-line", but I can't personally give any recommendations, as I have not tried them myself.