Shrink pdf size with Ghostscript.

compression ghostscript pdfs

For compressing pdfs, ghostscript works great. I use a command similar to this one,

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

I never remember this command. I look it up from notes, which I’m finally gotten tired of doing.

I frequently forget the options for -dPDFSETTINGS. They are:

  • \screen
  • \ebook
  • \printer
  • \prepress

And you can find how these optons are linked to other ghostscript settings in the big table here.

Remember to check your final output, to see if the compression distorts the images too much.

© Amy Tabb 2018 - 2023. All rights reserved. The contents of this site reflect my personal perspectives and not those of any other entity.