Sometimes people create PDF files with large images, resulting in files that are too large to email or sometimes even upload on web forms.
A quick and dirty way to compress such files is using ghostscript in a terminal, which you can install on macOS using homebrew (brew install ghostscript):
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=192 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile="${1%.*}.compressed.pdf" myfile.pdf
Replace “myfile.pdf” with the file to compress.
For convenience, you can create a function:
pdfc() {
command gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=192 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile="${1%.*}.compressed.pdf" "$1"
}
Use like so:
pdfc myfile.pdf
And a smaller pdf file will be written to myfile.compressed.pdf.
This isn’t without cost. The resulting PDF file will contain lower resolution images which have less detail and will look worse zoomed in, but you can tweak the resolution settings to see what works for you. Generally I find the above settings acceptable for most documents at normal reading size. It will reduce a file with 3 large images captured with a phone from 6Mb to around 100Kb.

Thanks for sharing this — the Ghostscript one-liner is a neat approach, and wrapping it in a pdfc function makes it easy to reuse. The quality trade-off you mention is the key point: at normal reading size the text stays fine, but zooming in shows the images are softer, so it is worth checking the output before sending. For anyone who does not want to use the terminal, free browser tools do the same job without installing anything — Smallpdf’s compressor is straightforward, and KBConverter (kbconverter.net) is handy when an email or form limit needs an exact target size, as it lets you aim for a set KB size rather than just low, medium or high. Either way, a quick check of the compressed file before sending saves an embarrassing blurry attachment.