#!/bin/bash
#size=`perl -e 'use Impedance::Header; print $Impedance::Header::pssize;'`
#$Id: ps2png,v 1.4 2013/11/05 11:45:07 sqko Exp $
echo "quit" | /usr/bin/gs -q -sDEVICE=png256 -sOutputFile=/tmp/dump$$.png $1 > /dev/null 2> /dev/null

#/usr/bin/convert -trim -rotate 90 -resize 600x800 /tmp/dump$$.png /tmp/dump1$$.png
#/usr/bin/convert -size 600x800 xc:white -gravity northwest -compose over /tmp/dump1$$.png /tmp/dump$$.png
#/usr/bin/convert -border 10x10 -bordercolor white /tmp/dump$$.png   /tmp/dump1$$.png
/usr/bin/convert -trim -rotate 90 /tmp/dump$$.png $2
rm -f /tmp/dump$$.png
rm -f /tmp/dump1$$.png
