Lots of times a scanned document or a downloaded webpage becomes a huge PDF file. To compress it, there are several options.
We can use Ghostscript as a command from the Terminal:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Another command line tool to use is ps2pdfwr:
ps2pdfwr input.pdf output.pdf
For those of you who prefer a graphical user interfaces, check out Densify. It has an AppImage and is a pretty cool GUI for Ghostscript.
We can also add a Ghostscript via System Settings > Actions > Download, search for Compress PDF, then click on the Install icon next to it, then go to the Manage tab and enable it by clicking on the + sign. Now we can open Nemo, right click on a PDF file and compress it.
All of these tools compress a PDF at about a 30:1 ratio, meaning that a 30 MB input PDF file will become 1 MB large.