Problem scenario
You want your PDF to retain the same content. But you want the file size to be reduced. You have access to a command prompt of an Ubuntu Linux server with no GUI environment. What should you do?
Possible Solution #1
If the fidelity of the reduced size PDF is important, try this solution (as we believe it is relatively lossless).
1. Install Ghostscript:
sudo apt -y install ghostscript
2. Run the following two commands where "foobar.pdf" is the name of your large PDF file:
pdf2ps foobar.pdf foobar.ps
ps2pdf foobar.ps smallfoobar.pdf
Possible Solution #2
If a minor reduction in quality is acceptable and it is very important to reduce the size by a large amount, try this solution.
- Install this package:
sudo apt -y install graphicsmagick-imagemagick-compat
- Run this command (where foobar.pdf is the name of the PDF you want to shrink):
convert foobar.pdf -compress Zip small.pdf