please dont rip this site

UK AC York CS Www-users Http ~fisher Software Pstools Pstobm Psrender.txt

# ! /bin/sh
# psrender -- cvt PostScript to ppm or Group3 bitmap
#
# This is a "helper" program which lives in /usr/fisher/mipslib
# and is not meant to be called directly.

PATH=/york/mips/bin:/bin:/usr/bin:
glog=/tmp/$$.glog
otemp=/tmp/$$.ppm

rc=0

trap "rm -f $glog $otemp; exit \$rc" 0

fail()
  { echo "psrender: $1" >&2
    rc=1; exit
  }

for sig in 1 2 3 13 15
do
  trap "fail \"Signal $sig!\"" $sig
done

xdpi=72
ydpi=72
dev=ppm

while :
do
    case "$1" in
	-dpi)
	    # resolution, dots per inch
	    xdpi="$2"; ydpi="$3"
	    shift; shift; shift;;

	-m)
	    # monochrome
	    dev=pbm
	    shift;;

	-g3)
	    # Group3 fax
	    dev=faxg3
	    shift;;

	-?*)
	    fail "bad option: $1";;

	*)
	    break;;
    esac
done

[ $# != 2 ] && fail "Usage: psrender [-dpi x y] [-m | -g3] in.ps out\n(either file can be -)"

# compute page size by multiplying A4 dimensions by dots per inch

mul() { echo "$1 $2 * 0.5 + 0 k 1 / p" | dc; }  # multiply, round to nearest integer

xsize=`mul $xdpi 8.2765`
ysize=`mul $ydpi 11.705`

# see /york/mips/bin/pstopdf
gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=$dev \
   -r${xdpi}x${ydpi} -g${xsize}x${ysize} -sOutputFile=$otemp \
   -c save pop -f "$1" -c quit >$glog

# see if there are any error msgs
read xxx <$glog &&
  { cat $glog >&2; echo >&2
    fail "GhostScript failed!"
  }

case "$2" in
    -)
	cat $otemp;;
    *)
	cp $otemp "$2";;
esac



file: /Techref/uk/ac/york/cs/www-users/http/~fisher/software/pstools/pstobm/psrender.txt, 1KB, , updated: 2000/4/4 11:05, local time: 2025/2/11 08:59,
TOP NEW HELP FIND: 
18.119.167.244:LOG IN

 ©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.com/techref/uk/ac/york/cs/www-users/http/~fisher/software/pstools/pstobm/psrender.txt"> uk ac york cs www-users http ~fisher software pstools pstobm psrender</A>

Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .