#!/bin/sh # # PJL wrapper for duplex printing of Postscript jobs # # MJR 12/98 # added -P option 10/99 # added -land option 1/00 # converted from PJL to PS 12/03 # out="cat" tumble=false if [ x"$1" = x-land ] then tumble=true shift fi case x$1 in x-P*) out="lpr $1" shift ;; esac if [ "x$1" != x ] then if [ ! -s "$1" ] then echo "File $1 does not exist or is of zero length" echo echo "Usage: `basename $0` [-land] [-Pxx] [filename]" echo echo "E.g.: `basename $0` myfile.ps | lpr -Ppsc" echo " or `basename $0` -Ppsc myfile.ps" echo " are equivalent" echo echo " -land duplexes in the manner appropriate for landscape pages" echo exit 1 fi fi { echo "%!" echo '<< /Duplex true' echo " /Tumble $tumble" echo '>> setpagedevice' echo '/setpagedevice {pop} bind def' cat $1 } | $out