- Download and install Ghostscript for windows (http://downloads.ghostscript.com/public/gs916w32.exe)
- Optional - Add the ghostscript directory to the path environment variable
- Control Panel > System > Advanced System Settings > Environment Variables
- Add
;C:\Program Files (x86)\gs\gs9.16\bin
to th end of thePATH
variable
-
Open CMD & Navigate to the correct folder
- Alternatively
shift+right click
in the correct folder on windows explorer > Open command window here
- Alternatively
-
Set the local path to include the GS binaries (If not set globally)
SET PATH=%PATH%;C:\Program Files (x86)\gs\gs9.16\bin
-
Use the following command to compress
source.pdf
intocompressed.pdf
(Change as required)gswin32c -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf source.pdf
It is possible to further reduce filesize by lowering quality using the -dPDFSETTINGS
argument with values of /ebook
or /screen
, however this severely reduced image quality for the example PDF I tried.
gswin32c -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf source.pdf
gswin32c -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf source.pdf
Amazing, thank you.