Skip to content

Instantly share code, notes, and snippets.

@knugie knugie/reduce_pdf.sh
Created Oct 24, 2013

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner 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

This comment has been minimized.

Copy link
Owner 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

This comment has been minimized.

Copy link
Owner 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

This comment has been minimized.

Copy link

brandoncc commented Apr 11, 2017

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
You can’t perform that action at this time.