Skip to content
← All guides

How to compress a folder of PDFs at once on a Mac

Shrink dozens of PDFs in one go on a Mac with an Automator Quick Action or a Terminal loop, and keep the originals safe while you do.

The problem

You have a folder of PDFs to shrink before an upload or an archive, and exporting them one at a time from Preview is an afternoon.

How do I compress multiple PDFs at once on a Mac?

Make an Automator Quick Action, then run it on any selection in Finder:

  1. Open Automator and choose Quick Action. Set it to receive PDF files in Finder.
  2. Add Copy Finder Items first, so the originals are kept.
  3. Add Apply Quartz Filter to PDF Documents and choose Reduce File Size.
  4. Save it. Select the PDFs in Finder, Control click, and run it from Quick Actions.

Will batch compressing overwrite my files?

Automator's filter action changes files in place unless you add Copy Finder Items first. Keep that step, and test on a few copies before you run it on everything.

How do I batch compress PDFs in Terminal?

With Ghostscript, writing to a new folder:

brew install ghostscript
mkdir smaller
for f in *.pdf; do
  command gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -dQUIET \
    -sOutputFile="smaller/$f" "$f"
done

command gs rather than gs is deliberate: some shells set up gs as a shortcut for git switch, as ours was, and the shortcut would run instead.

Our take

Check the largest result and the smallest, not a random one. Batch settings suit some files and ruin others: a scan can come out larger than it went in, and a photo heavy file blurry. The two extremes tell you whether one setting is right for the whole folder.

In Simply PDF

Simply PDF's Compress only keeps a result when it is smaller, and shows before and after so you can trust the setting. It needs a key. For one file, see compress a PDF without the blur.

Questions

How do I compress multiple PDFs at once on a Mac?

Make an Automator Quick Action with Apply Quartz Filter to PDF Documents, or loop over the files with Ghostscript in Terminal.

Will batch compressing overwrite my files?

Automator's filter action changes files in place unless you add Copy Finder Items first. The Terminal loop writes to a new folder.

More guides