/[scripts]/trunk/pdf-optimize.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/pdf-optimize.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 143 - (show annotations)
Sun May 22 12:31:13 2011 UTC (12 years, 10 months ago) by dpavlin
File MIME type: application/x-sh
File size: 446 byte(s)
http://blog.rot13.org/2011/05/optimize-pdf-file-size-using-ghostscript.html
1 #!/bin/sh -x
2
3 for=screen
4
5 cat << _FOR_OPTIONS_
6 # screen low-resolution "Screen Optimized"
7 # ebook medium-resolution "eBook"
8 # printer output "Print Optimized"
9 # prepress output "Prepress Optimized"
10 # default
11 _FOR_OPTIONS_
12
13 test ! -z "$2" && for=$2
14 to=`echo $1 | sed "s/\.pdf/-$for.pdf/i"`
15
16 time gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/$for \
17 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=/tmp/$to $1 \
18 && ls -al $1 /tmp/$to
19

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26