Compress or optimize PDF size the most optimal way. Most of the PDF size comes from images. Images that might be 2-3 MB in size, but is viewed only as thumbnail. So this reduces the image for optimal size. So it appears to look the same, but the images DPI is reduced. Under the ghostscript I included the variants you can use to get the optimization you need. You can still get a really good optimization, even if you use a sharp 300 dpi.
Source code viewer
- # Get ghostscript with your package manager (aptitude, yum, pacman, yaourt);
- apt-get install ghostscript
- # Run ghostscript.
- gs -dSAFER -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dINTERPOLATE -dNOPAUSE -dQUIET -dBATCH -dNumRenderingThreads=8 -r300 -sOutputFile=output.pdf -c 30000000 setvmthreshold -f input.pdf
- # -dPDFSETTINGS=
- # /screen - 72 dpi images
- # /ebook - 150 dpi images
- # /printer - 300 dpi images
- # /prepress - color preserving, 300 dpiProgramming Language: Bash