Shrinking PDFs with Ghostscript on the command line
I needed to shrink a PDF last week — something I don’t do often enough to remember the flags. Ghostscript is the tool, and it’s already on most Linux machines or a quick apt install ghostscript away. The command is: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen \ -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf The bit that actually matters is -dPDFSETTINGS=/screen. That’s the quality dial. /screen gives you the smallest file — fine for emailing or uploading, rubbish if you need to print anything. ...