home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # Inspired by pshalf written by Denise Draper denise@cwi.nl
- # This is wpshalf by Pell pell@rainier.UUCP
-
- cat >/tmp/psh.$$ # Must work with tempfile
- awk '
- BEGIN { firsthalf = 1 } # I would like to use "pages" here :-(
- /^bop$/ { if (!(pages % 2)) {
- if (firsthalf) {
- print "bop"
- print "7 DPIy mul 0 translate"
- } else {
- print "-7 DPIy mul 0 translate"
- }
- } else print "bop"
- next
- }
- /^eop$/ { if (pages % 2) {
- pages = 0
- print "eop"
- } else {
- if (!firsthalf) print "eop"
- firsthalf = 1 - firsthalf
- }
- next
- }
- /^\/stateInit/ {
- print "/wpshalfInit {"
- print "54 DPIx div 54 DPIy div neg scale"
- print "/PSpagelength 11 DPIy mul def %default 8.5 x 11 inches"
- print "/PSpagewidth 8.5 DPIx mul def"
- print "90 rotate"
- print "PSpagewidth 6.5 DPIx mul add neg"
- print " PSpagelength 0.5 DPIy mul add neg translate"
- print ".5 .5 translate %PS lattice points are between pixels"
- print "} def"
- print "/stateInit {"
- next
- }
- /^stateInit$/ { print "wpshalfInit"; next }
- #/^headerpage|^logme/ { next } # remove headerpage
- { print $0 } ' pages=`egrep -c '^bop$' /tmp/psh.$$` /tmp/psh.$$
-