Inkscape from command line

When a script should produce a vector image as output I love to use SVG, an XML and pure text format. Then you can use Inkscape to convert the XML (SVG) file into PDF or PNG:

inkscape -f FILENAME.svg -A FILENAME.pdf
inkscape -f FILENAME.svg -w WIDTH -h HEIGHT -e FILENAME.png

Thus for a fast batch conversion:

for i in *.svg; do inkscape -f $i -w 1024 -e $(echo $i|sed 's/svg/png/'); done

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s