I have tried several apps to compress PDF files and the best one in my opinion in terms of useability and compression is ghostscript.
Install
Run from a terminal below command if you are based on Debian and children.
1 | # ghostscript - interpreter for the PostScript language and for PDF |
Use
Run the following command to reduce the file-size of your PDF:
1 | ghostscript -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/print -sOutputFile=new_file.pdf original_file.pdf |
Note: You can use gs if you wish. For me it is an alias for git status.
1 | type ghostscript |
Now you have a few options here under -dPDFSettings:
- /screen Selects low-resolution output (72 dpi), and the lowest file-size.
- /ebook Selects medium-resolution output (150 dpi), with a medium file-size.
- /printer and /prepress are both the high-resolution options (300 dpi), which is mainly used for printing PDFs. As you might have guessed, this option gives you the biggest file-size (yes, even bigger than your mother).
References
- How to Use Ghostscript: https://www.ghostscript.com/doc/9.20/Use.htm