Skip to content

Instantly share code, notes, and snippets.

@knugie
Created October 24, 2013 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save knugie/7143248 to your computer and use it in GitHub Desktop.
Save knugie/7143248 to your computer and use it in GitHub Desktop.
reduce pdf size
#reduce PDF size
#-dPDFSETTINGS
# /screen
# /ebook
# /printer
# /prepress
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -sOutputFile=out.pdf in.pdf
@knugie
Copy link
Author

knugie commented Oct 24, 2013

!/bin/sh

from http://www.alfredklomp.com/programming/shrinkpdf/

gs -q -dNOPAUSE -dBATCH -dSAFER
-sDEVICE=pdfwrite
-dCompatibilityLevel=1.3
-dPDFSETTINGS=/screen
-dEmbedAllFonts=true
-dSubsetFonts=true
-dColorImageDownsampleType=/Bicubic
-dColorImageResolution=72
-dGrayImageDownsampleType=/Bicubic
-dGrayImageResolution=72
-dMonoImageDownsampleType=/Bicubic
-dMonoImageResolution=72
-sOutputFile=out.pdf
$1

@knugie
Copy link
Author

knugie commented Oct 24, 2013

from http://pandemoniumillusion.wordpress.com/2008/05/07/compress-a-pdf-with-pdftk/

pdf2ps large.pdf very_large.ps
ps2pdf very_large.ps small.pdf

@knugie
Copy link
Author

knugie commented Jun 6, 2014

Bug "Unrecoverable error: stackunderflow in .setdistillerparams"
[GPL Ghostscript 9.10 (2013-08-30)]
use the following option:

-dUseCIEColor

@brandoncc
Copy link

This fixed the issue for me using shrinkpdf. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment