Skip to content

Commit 0458223

Browse files
committed
Write up scripts to convert SVG to other formats with Inkscape in batch, for MAC OSX and Inkscape 0.90+ only.
1 parent 9bc4369 commit 0458223

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

svg2pdf.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# For MAC OSX ONLY, where the CLI inkscape cannot find files with relative path
3+
4+
for file in `find img -type f -name *.svg`
5+
do
6+
base=$(basename $file .svg);
7+
echo "Converting: $base.svg -> $base.pdf";
8+
/Applications/Inkscape.app/Contents/Resources/bin/inkscape --export-pdf="$PWD/img/generated/$base.pdf" "$PWD/img/$base.svg"
9+
done

svg2png.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# For MAC OSX ONLY, where the CLI inkscape cannot find files with relative path
3+
4+
for file in `find img -type f -name *.svg`
5+
do
6+
base=$(basename $file .svg);
7+
echo "Converting: $base.svg -> $base.png";
8+
/Applications/Inkscape.app/Contents/Resources/bin/inkscape --export-png="$PWD/img/generated/$base.png" "$PWD/img/$base.svg"
9+
done

0 commit comments

Comments
 (0)