#!/bin/sh # # View an Encapsulated PostScript File with Acrobat Reader # usage () { echo "usage: epsview [-x xoff] [-y yoff] [-s scale]" >&2 exit 1 } x=0 y=0 s=1 while getopts ":x:y:s:" c do case "$c" in x) x=$OPTARG;; y) y=$OPTARG;; s) s=$OPTARG;; :|'?') usage;; esac done shift $(($OPTIND - 1)) if [ $# -lt 1 ]; then usage; fi tmp=$(cat "$1" | nawk '/^%%BoundingBox:/ { print (- $2) " " (- $3) }') llx_adj=${tmp% *}; lly_adj=${tmp#* } tmpfile=$(mktemp ~/.epsview.XXXXXX) || exit 1 ( cat <$tmpfile acroread $tmpfile || { rm -f $tmpfile; exit 1; } rm -f $tmpfile .