Skip to content

Instantly share code, notes, and snippets.

@andreyuhai
Last active August 22, 2020 07:21
Show Gist options
  • Save andreyuhai/2576f4bf3325ff9c1d7a291da62cd098 to your computer and use it in GitHub Desktop.
Save andreyuhai/2576f4bf3325ff9c1d7a291da62cd098 to your computer and use it in GitHub Desktop.
Reduce PDF Size

Compress a PDF

Source

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
  • -dPDFSETTINGS=/screen lower quality, smaller size. (72 dpi)
  • -dPDFSETTINGS=/ebook for better quality, but slightly larger pdfs. (150 dpi)
  • -dPDFSETTINGS=/prepress output similar to Acrobat Distiller "Prepress Optimized" setting (300 dpi)
  • -dPDFSETTINGS=/printer selects output similar to the Acrobat Distiller "Print Optimized" setting (300 dpi)
  • -dPDFSETTINGS=/default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment