2 # ps-to-gifs, convert PS to multiple gifs or other bitmaps
7 Convert PS to multiple gifs or other bitmaps
8 Usage: ps-to-gifs.sh [OPTION]... [FILE]
11 -c, --crop crop output
12 -o, --output=NAME set output base
13 -p, --png convert to png
14 -s, --size=SIZE set papersize
15 -t, --transparent change white to transparent
27 while [ $# -gt 0 ]; do
32 color='-transparent white'
43 --o*=*) OUTFILE=`echo $opt | sed -e s/"^.*="//`
49 -s) SIZE="-sPAPERSIZE=$2"; shift
52 SIZE="-sPAPERSIZE=`echo $opt | sed -e s/"^.*="//`"
55 echo "ps-to-gifs: unknown option: \`$opt'"
64 if [ "x$TRANSPARENT_IS_BROKEN" != "x" ]; then
68 if [ "x$OUTFILE" = "x" ]; then
69 BASE=`dirname $FILE`/`basename $FILE .ps`
71 BASE=`dirname $OUTFILE`/`basename $OUTFILE .$GIF`
75 rm -f $BASE{.ppm,.$GIF} $BASE-page*{.ppm,.$GIF}
77 cat $FILE | gs -sDEVICE=pgm $SIZE -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile="$BASE-page%d.ppm" -r90 -dNOPAUSE - -c quit $FILE
79 # cat $PPMFILE | ppmquant 2 | pnmscale 0.3333 | pnmcrop | $PNMTOGIF $color > $OUTFILE
82 o=`dirname $i`/`basename $i .ppm`.$GIF
83 cat $i | $CROP | $PNMTOGIF $color > $o
87 if [ "x$OUTFILE" != "x" ]; then
88 mv $BASE-page1.$GIF $BASE.$GIF