# ! /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 12:05, local time: 2025/7/23 00:34,
216.73.216.152,10-2-198-94: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? <A HREF="http://www.ecomorder.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 ecomorder.com! |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.