gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -sOutputFile=”outfile.pdf” “infile.pdf”
其中infile.pdf和outfile.pdf分别是输入、输出文件名。
还可以将其写成一个脚本,比如叫compresspdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -sOutputFile=”$2″ “$1″
添加可执行权限,放入执行文件目录
compress infile.pdf outfile.pdf
注:参考了nautilus的PDF压缩脚本,参见http://www.ubuntuhome.com/compress-pdf.html




