#!/bin/csh set width = "" set height = "" set defaultSize = "150" set temp = /tmp/tmp.png if ( $# == 0 ) then echo "Usage $0 [-w width] [-h height] file.pdf ...." echo " If size or hight is left out then aspect ratio will be preserved." echo " Only first page image is produced." exit endif while ( "-$1:s/-//" == "$1" ) switch ( $1 ) case "-w": set width = $2 shift shift breaksw case "-h": set height = $2 shift shift breaksw default: echo "Unknown option $1" exit endsw end set size = "" if ( "$width" != "" ) then set size = $width endif if ( "$height" != "" ) then set size = ${size}x${height} endif if ( "$size" == "" ) then set size = "$defaultSize" endif foreach f ( $* ) pstoimg -quiet -antialias -aaliastext -out $temp $f convert -filter Mitchell -resize $size $temp ${f:r}_cover.gif end