transfer pdf to png
#! /bin/bash
#
# transfer pdf to png
if [ $# != 1 ] ; then
echo "USAGE: $0 PDF FILE ABSOLUTELY PATH."
echo " e.g.: $0 /data/abc.pdf"
exit 1;
fi
filedir=`dirname $1`
filename=`basename $1`
transfer(){
gs -dNOSAFER -r300 -dBATCH -sDEVICE=pngalpha -dNOPAUSE -dEPSCrop -sOutputFile=${filedir}/${filename%.*}%d.png $1 > /dev/null 2>&1
ls ${filedir}/${filename%.*}*.png |wc -l
}
transfer $1;
执行
sh *.sh *.pdf