#!/usr/bin/ksh # PSRESIZE=/usr/local/bin/psresize # Path to psresize echo "poster_resize v1.0" # Remove ending ".ps" if $1 is not empty FILE= if [ -n "$1" ] then FILE=`basename $1 .ps` fi INFILE=${FILE}.ps OUTFILE=${FILE}.resize.ps TMPFILE=/tmp/ps-resize.$$.ps # Test existence of the PS File if [ ! -r "${INFILE}" ] then ### DVI-File not found if [ -z "$1" ] then echo "error: no input file specified" else echo "error: file "${INFILE}" not found" fi echo "usage: poster_resize_UF []" exit fi echo "Input file: ${INFILE}" # Is a Scale specified? if [ -n "$2" ] then SCALE=$2 echo "Specified scale-factor is: ${SCALE}" else SCALE=2.828 echo "No scale-factor specified. Using default value (ie. A3->A0): ${SCALE}" fi # Do the job grep '%%BoundingBox: ' ${FILE}.ps | read -r DUMMY X0 Y0 X1 Y1 echo "Old Bounding Box: ${X0} ${Y0} ${X1} ${Y1}" dc < ${OUTFILE} rm -f ${TMPFILE} echo "Job done. Created: ${OUTFILE}"