Shrink pdf size with Ghostscript.
18 Oct 2023For 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.