0

I am using pdfsizeopt to try to minimise a large pdf document. The original size is 27.8 MB and contains around 120 images. Most are jpg, some are png.

I run the command pdfsizeopt/pdfsizeopt input.pdf output.pdf but the output file is 93% of the original size ~25MB.

Is there a way to reduce the file size further?

10
  • Compressing something that has already been compressed doesn't save much. What's the total size of the images? – egreg Jun 15 '20 at 10:38
  • @egreg The figures folder is 27.4MB – phald Jun 15 '20 at 11:15
  • What type of images are they (photographs, diagrams, data plots, etc.)? – Ian Thompson Jun 15 '20 at 11:21
  • @IanThompson There are some colour images, some b&w images/plots and some png plots. When I saved the JPGs, I tried to reduce their file size by setting the horizontal dimension to ~1200 pixels – phald Jun 15 '20 at 11:28
  • Try exporting the plots as either pdf or eps files. – Ian Thompson Jun 15 '20 at 11:33
2

I always have a better compression with gs, both Tex-produced and scanned pdf files.

gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=144 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile=compressed.pdf original.pdf

-dPDFSETTINGS= specifies the quality /resolution of the output PDF. You can choose from the following:

  • -dPDFSETTINGS=/screen (72 dpi images)
  • -dPDFSETTINGS=/ebook (150 dpi images)
  • -dPDFSETTINGS=/printer (300 dpi images)
  • -dPDFSETTINGS=/prepress (300 dpi images, color preserving)
  • -dPDFSETTINGS=/default
6
  • How would I run such a script? From command prompt? – phald Jun 22 '20 at 9:17
  • @phald Yes, you run it from command line. – Tony Tan Jun 22 '20 at 19:12
  • Okay thanks, I tried that but I see an error: "gs" is not recognised as an internal or external command, operable program or batch file. – phald Jun 23 '20 at 8:12
  • you will need to install ghostscript for your system, ghostscript.com. – Tony Tan Jun 24 '20 at 5:36
  • I have Ghostscript 9.26 installed on managed desktop and it shows in the programs of the start menu – phald Jun 24 '20 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.