I made a small shell script, to convert all files in a directory with the extensions svg, eps, pdf to the file types pdf, eps, png.
Linux + Inkscape necessary
1. put the script in the same folder where the files are
2. open up a terminal (Strg + Shift + T)
3. cd to the same directory where the script is
4. write "sh InkscapeBatchConverter.sh"
5. follow the instructions
Here's the code of the script:
Code: Select all
#!/bin/sh
count=0
validInput1="svg"
validInput2="pdf"
validInput3="eps"
validOutput1="eps"
validOutput2="pdf"
validOutput3="png"
echo "This script allows you to convert all files in this folder from one file type to another."
valid=0
echo "Allowed file types for source: $validInput1, $validInput2, $validInput3"
while [ "$valid" != "1" ]
do
read -p "What file type do you want to use as a source? " sourceType
if [ "$sourceType" = "$validInput1" ] || [ "$sourceType" = "$validInput2" ] || [ "$sourceType" = "$validInput3" ]; then
valid=1
else
echo "Invalid input! Please use one of the following: $validInput1, $validInput2, $validInput3"
fi
done
valid=0
echo "Allowed file types for output: $validOutput1, $validOutput2, $validOutput3"
while [ "$valid" != "1" ]
do
read -p "What file type do you want to convert to? " outputType
if [ "$outputType" = "$validOutput1" ] || [ "$outputType" = "$validOutput2" ] || [ "$outputType" = "$validOutput3" ]; then
valid=1
else
echo "Invalid input! Please use one of the following: $validOutput1, $validOutput2, $validOutput3"
fi
done
read -p "With what dpi should it be exported (e.g. 300)? " dpi
for fileSource in *.$sourceType
do
if [ -f "$fileSource" ]; then
count=$((count+1))
file=$(echo $fileSource | cut -d'.' -f1)
echo $count". "$fileSource" -> "$file.$outputType
inkscape $fileSource --export-$outputType=$file.$outputType --export-dpi=$dpi
else
echo "no file $fileSource found!"
fi
done
echo "$count file(s) converted!"
You can download the file here: http://ge.tt/7C8JFmF1/v/0?c
I hope this helps!
€dit: Windows script will come in the next days.