#!/bin/sh if [ "$1" = "" ]; then echo -e 'Usage: pstogif FILE\n' exit 1 fi DPI=300 SCL=0.3 for NAME in $* ; do echo $NAME FILE=`echo $NAME | awk 'BEGIN{FS=".";} {print $1}'` gs -q -dSAFER -sPAPERSIZE=letter -sDEVICE=pcx24b -sOutputFile="$FILE"_%0ld.pcx -dNOPAUSE -r"$DPI"x"$DPI" $NAME quit.ps for PAGE in "$FILE"_*.pcx ; do GIF=`echo $PAGE | awk 'BEGIN{FS=".";} {print $1}'` pcxtoppm < $PAGE | pnmscale $SCL | ppmquant 256 | ppmtogif > $GIF.gif done done