compress pdf on linux code example
Example 1: ubuntu console shrink pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Example 2: linux compress a pdf
ps2pdf large.pdf small.pdf