Created
July 14, 2017 21:02
-
-
Save connorjan/813e7605db680159f8273b483bd27bd3 to your computer and use it in GitHub Desktop.
Convert an SVG to EPS using Inkscape on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Requirements: | |
# You must have the path to Inkscape in your path | |
# (/Applications/Inkscape.app/Contents/Resources/bin/inkscape) | |
# You must have coreutils installed ($ brew install coreutils) for greadlink | |
if (($# < 1)); then | |
echo "Usage: svg2eps input output" | |
exit 1 | |
fi | |
p_in="$1" | |
input="$(greadlink -f $1)" | |
if [ -z "$2" ]; then | |
p_out="${1%.*}.eps" | |
output="${input%.*}.eps" | |
else | |
p_out="$2" | |
output="$(greadlink -f $2)" | |
fi | |
inkscape -z -D -f "$input" -E "$output" | |
if (($?)); then | |
echo "Error in conversion" | |
exit 1 | |
else | |
echo "Success: $p_in -> $p_out" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment