Skip to content

Instantly share code, notes, and snippets.

@protrolium
Last active December 24, 2023 18:57
Show Gist options
  • Save protrolium/33417174ffcade58443f7c5dc851d345 to your computer and use it in GitHub Desktop.
Save protrolium/33417174ffcade58443f7c5dc851d345 to your computer and use it in GitHub Desktop.
using ghostscript to compress PDF filesize

Compress PDF filesize

$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \ -dNOPAUSE -dBATCH -dColorImageResolution=150 \ -sOutputFile=output.pdf someBigFile.pdf

Combine/Merge PDFs

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf source1.pdf source2.pdf source3.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment