Skip to content

Instantly share code, notes, and snippets.

@winder
Created February 1, 2014 19:52
Show Gist options
  • Save winder/8757756 to your computer and use it in GitHub Desktop.
Save winder/8757756 to your computer and use it in GitHub Desktop.
# Convert SVG to EPS
function svgToEps()
{
if test $# -lt 1 ; then
echo "You need to pass in a filename." ; return
fi
epsfile=${1%.*}.eps
echo "inkscape -f $1 -E $epsfile"
inkscape -f $1 -E $epsfile &> /dev/null
}
function svgToDxf()
{
if test $# -lt 1 ; then
echo "You need to pass in a filename." ; return
fi
base=${1%.*}
epsfile=${base}.eps
dxffile=${base}.dxf
svgToEps $1
echo "pstoedit -dt -f 'dxf:-polyaslines -mm' ${epsfile} ${dxffile}"
pstoedit -dt -f 'dxf:-polyaslines -mm' ${epsfile} ${dxffile} &> /dev/null
rm $epsfile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment