Skip to content

Instantly share code, notes, and snippets.

@rohit1kumar
Last active September 12, 2024 05:55
Show Gist options
  • Save rohit1kumar/5d6af8ac5822609e0d9bcd9555c04ff5 to your computer and use it in GitHub Desktop.
Save rohit1kumar/5d6af8ac5822609e0d9bcd9555c04ff5 to your computer and use it in GitHub Desktop.
Compress PDF with GhostScript
  1. Install GhostScript
    sudo apt install ghostscript #ubuntu
  1. Run
    gs -sDEVICE=pdfwrite \
       -dCompatibilityLevel=1.4 \
       -dPDFSETTINGS=/ebook \
       -dNOPAUSE \
       -dBATCH \
       -dQUIET \
       -sOutputFile=compressed_file.pdf \
       original_file.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment