#! /bin/sh # # This is geomfix, Copyright 1992 Silvio Levy # $Header: /a/tampa/h/tampa_a/fac/levy/texts/geombook/RCS/geomfix,v 1.1 92/07/17 13:27:45 levy Exp $ # # This shell file reads stdin (or any list of files) and adds a header # similar to the one added by psfix, but without any of the definitons. # It also abbreviates certain PostScript commands. # Defaults: lmargin=1.0 # default left margin: .5 inches rmargin=1.0 # default right margin: .5 inches bmargin=1.0 # default bottom margin: .5 inches tmargin=1.0 # default top margin: .5 inches width=8.5 # default page width: 8.5 inches height=11 # default page height: 11 inches transform='' # default transformation: identity nodistort=true # default no-stretching: no fixwid=false # default fixwid compensation fixdash=false # default fixdash compensation while :; do case $# in 0) break 2 ;; esac case "$1" in -lmarg) shift lmargin=$1 shift ;; -rmarg) shift rmargin=$1 shift ;; -bmarg) shift bmargin=$1 shift ;; -tmarg) shift tmargin=$1 shift ;; -width) shift width=$1 shift ;; -height) shift height=$1 shift ;; -land) tmp=$width width=$height height=$tmp transform="90 rotate 0 Mheight neg translate" shift ;; -stretch) nodistort=false shift ;; -stringfix) fixwid=false shift ;; -dashfix) fixdash=false shift ;; -*) echo \ 'Usage: psfix [-lmarg inches] [-rmarg inches] [-bmarg inches] [-tmarg inches] [-land] [-stretch] [-width inches] [-height inches] [-stringfix] [-dashfix] [file...]' \ >&2 exit 1 ;; *) break 2 ;; esac done # Output header echo '%!PS-Adobe-2.0 EPSF-2.0' # Compute bounding box ( bc <$/setcmykcolor/ s/\$/Ma/g s/\$/a/g s/\$/c/g s/\$/d/g s/\$/f/g s/\$/g/g s/\$/gr/g s/\$/gs/g s/\$/k/g s/\$/l/g s/\$/lw/g s/\$/m/g s/\$/n/g s/\$/r/g /^%%Creator:/d' $@ echo end