summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh
blob: 4cef12f11fbf77c64d6ce6bf788a9754b1db904f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
prefwidth=640
prefheigh=480
prefratio=$(( 1000 * $prefwidth / $prefheigh ))
tmpfilename=`mktemp simpleviewer.XXXXXX`
epstopdf --nogs $1 > $tmpfilename
epswidth=`identify $tmpfilename | cut -d " " -f 3 | cut -d x -f 1`
epsheigh=`identify $tmpfilename | cut -d " " -f 3 | cut -d x -f 2`
aspectra=$(( 1000 * $epswidth / $epsheigh ))
if test $aspectra -ge $prefratio
then resol=$(( 72 * $prefwidth / $epswidth )) 
else resol=$(( 72 * $prefheigh / $epsheigh ))
fi
echo "                                             Resolution:" $resol "dpi."
gs -q -r$resol -sDEVICE=x11 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 $tmpfilename
rm $tmpfilename