Reduce PDF file size

This topic is about reducing pdf file size using ghostscript in linux.

To Install Ghostscript in linux.
sudo apt update
sudo apt install ghostscript
To reduce the file size of pdf. Replace input.pdf with the PDF file you want to compress, and replace output.pdf with the name of the compressed file you want to create.
gs -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dDownsampleColorImages=true \
-dColorImageDownsampleType=/Bicubic \
-dColorImageResolution=150 \
-dNOPAUSE -dQUIET -dBATCH \
-sOutputFile=output.pdf input.pdf

Last updated