The email bounces because the PDF is 40 MB. The first search result is a website that wants you to upload it — which is the last thing you want to do with a contract, a bank statement, or a scan of your passport. Handing a confidential document to a free converter just to shave off some megabytes is a bad trade.
Ghostscript in WSL compresses PDFs locally, for free, with one command. It downsamples the embedded images (where almost all the bloat lives) while leaving text crisp, and the file never leaves your machine.
If you don’t have WSL, set it up with the WSL install guide.
Install Ghostscript
sudo apt update && sudo apt install -y ghostscript
The command is gs. Confirm it:
gs --version
The command
This is the core of it — compress input.pdf into output.pdf:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -dQUIET -sOutputFile=output.pdf input.pdf
The piece that controls the size/quality trade-off is -dPDFSETTINGS. Everything else is boilerplate (-dNOPAUSE -dBATCH -dQUIET just stop it from prompting and printing noise).
Choosing the right preset
-dPDFSETTINGS picks a target image resolution. This is the dial that matters:
-dPDFSETTINGS presets
| /screen | Smallest file, ~72 dpi images — can look rough |
|---|---|
| /ebook | Best all-round balance, ~150 dpi |
| /printer | Higher quality, ~300 dpi, larger file |
| /prepress | Highest quality, ~300 dpi, color-preserving |
| /default | General-purpose, leans toward quality |
Start with /ebook. It usually gives a real size drop with images that still look fine on screen. Drop to /screen only if you need the absolute smallest file and can accept softer images.
Check the before and after
Always confirm the saving — and that the output still looks right:
ls -lh input.pdf output.pdf
-lh prints human-readable sizes side by side. Open output.pdf and skim a few pages, especially any with photos or fine detail, before you send it.
Compress several PDFs
To run the same compression across every PDF in a folder, into a compressed subfolder:
mkdir -p compressed
for f in *.pdf; do
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -dQUIET -sOutputFile="compressed/$f" "$f"
done
Originals stay where they are; the smaller copies land in compressed/.
When compression barely helps
If the result is hardly smaller, the PDF is probably mostly text or already-optimized images — there’s little for Ghostscript to remove. The big wins come from PDFs stuffed with large photos or high-resolution scans.
Wrapping up
Compressing a PDF on Windows is one Ghostscript line with one meaningful choice: the -dPDFSETTINGS preset. Use /ebook for the everyday balance, /screen when you need the smallest file, and check the result with ls -lh before sending.
It’s free, it batches, and it runs in WSL — so your contracts, statements, and scans never get uploaded to a compressor site. To split a large PDF down to just the pages you need (often smaller than compressing the whole thing), see split a PDF into separate pages.