#!/bin/sh # # View a PostScript file with Acrobat Reader # if [ $# -eq 0 ]; then echo "usage: psview file" >&2 exit 1 fi f=$1 # Get the real path if called by Mozilla if [ -n "$MOZILLA_FIVE_HOME" ]; then case "$f" in /usr/tmp/*) f="/usr/compat/linux$f" esac fi ts="$(file "$f")" t="${ts#*: }" case "$t" in PDF\ document*) acroread "$f"; exit 0;; #PostScript\ document*type\ EPS* | DOS\ EPS\ Binary\ File\ Postscript*) # epsopt=-dEPSFitPage;; esac tmpfile=$(mktemp ~/.psview.XXXXXX) || exit 1 ps2pdf $epsopt "$f" $tmpfile || { rm -f $tmpfile; exit 1; } acroread $tmpfile || { rm -f $tmpfile; exit 1; } rm -f $tmpfile exit 0 .