]>
git.sthu.org Git - ipestuff.git/blob - ipeify.sh
4 if [[ $# < "1" ]]; then
5 echo "$0 <file> [params to pdftoipe]"
7 echo "Convert eps, pdf and svg files to Ipe xml-files."
14 infileend
=${infile##*.}
16 if [[ ! -f "$infile" ]]; then
17 echo "No file '$infile'"
22 md5infile
=`cat $infile | md5sum | cut -d ' ' -f 1`
23 outfile
="${infile%%.*}.xml"
28 tmppdffile
="/tmp/${md5infile}.pdf"
33 epstopdf
"$infile" --outfile $tmppdffile ||
exit -2
37 inkscape
"$infile" --export-pdf=$tmppdffile ||
exit -2
41 echo "Script author is lame. Tell him!"
45 pdftoipe
$tmppdffile "$outfile" $@ ||
exit -2
50 pdftoipe
"$infile" "$outfile" $@ ||
exit -2
54 echo "Unknown filetype '$infileend'"