http://gengwg.blogspot.com/
I just opened gnome-terminal and searched:
my eye caught librsvg2-binCode:$ apt-cache search svg.*png inkscape - vector-based drawing program librsvg2-bin - command-line and graphical viewers for SVG files scribus - Open Source Desktop Page Layout ...
afterwards, i checked out the package to see the command for it:Code:$ apt-cache show librsvg2-bin ... Description: command-line and graphical viewers for SVG files The rsvg library is an efficient renderer for Scalable Vector Graphics (SVG) pictures. . This package includes a command-line utility to convert the SVG files to the PNG format and a graphical SVG viewer.
Cool, now we know the commands includedCode:$ sudo apt-get install librsvg2-bin ... $ dpkg -L librsvg2-bin ... /usr/bin/rsvg-convert /usr/bin/rsvg-view /usr/bin/rsvg ...
With some bash scripting you have a script:Code:$ rsvg-convert --help Usage: rsvg-convert [OPTION...] [FILE...] - SVG Converter Help Options: -?, --help Show help options Application Options: -d, --dpi-x=pixels per inch [optional; defaults to 90dpi] -p, --dpi-y= pixels per inch [optional; defaults to 90dpi] -x, --x-zoom= x zoom factor [optional; defaults to 1.0] -y, --y-zoom= y zoom factor [optional; defaults to 1.0] -z, --zoom= zoom factor [optional; defaults to 1.0] -w, --width= width [optional; defaults to the SVG's width] -h, --height= height [optional; defaults to the SVG's height] -f, --format=[png, pdf, ps, svg] save format [optional; defaults to 'png'] -o, --output output filename [optional; defaults to stdout] -a, --keep-aspect-ratio whether to preserve the aspect ratio [optional; defaults to FALSE] -v, --version show version information -b, --base-uri base uri
cheers!Code:$ cd your-directory-with-the-svgs/ $ for i in *; do rsvg-convert $i -o `echo $i | sed -e 's/svg$/png/'`; done
P.S. you can do a similar conversion using inkscape's command line:
Code:$ cd your-directory-with-the-svgs/ $ for i in *; do inkscape $i --export-png=`echo $i | sed -e 's/svg$/png/'`; done
Comments
Post a Comment
https://gengwg.blogspot.com/