Compress PDFs With Ghostscript
Rewrite a PDF with lower image resolution to shrink its size.
Run gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -o small.pdf big.pdf to compress.
01Command
Command
$ gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -o small.pdf big.pdf02What it does
Ghostscript renders and re-emits PDFs, and the PDFSETTINGS presets (/screen, /ebook, /printer, /prepress) trade image quality for size. It can also convert PostScript or EPS to PDF and flatten transparency.
03Risk
!Warning: Re-encoding reduces quality and can change fonts or embedded colour; keep the original until you verify the result.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- GhostscriptEvidence: Debian packages Ghostscript, a PostScript and PDF interpreter used to rewrite and optimise documents.
- Debian package: ghostscriptEvidence: Debian packages Ghostscript, a PostScript and PDF interpreter used to rewrite and optimise documents.
Last verified: 2026-09-22 · Category: Developer