1

In Acrobat 11 Pro, I can do File > Save As Other > Reduced Size PDF (setting as Acrobat 10 viewer or later), which cut a PDF to about 40% and looks exactly the same.

I am wondering how I can achieve the same result with an open source tool like ghost script, image magick, or some adobe tools on a linux server via CL or PHP.

Caleb Pitman
  • 1,105
  • 1
  • 12
  • 24

1 Answers1

0
gswin64c -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

This works pretty well to reduce the pdf file size. When getting used to ghostscript inside a batch script be wary of special characters. For example "%" is a special character for postscript so when using variable in cmd you have escape the character so % -> %% and %% -> %%%% This can cause a headache depending on what you are trying to do. Also paths are a pain, use CD and relative file paths.

Source

t3dodson
  • 3,949
  • 2
  • 29
  • 40