Batch convert differently sized SVG's to Same Width PNGs

Post questions on how to use or achieve an effect in Inkscape.
baconCatBug
Posts: 1
Joined: Mon Jul 01, 2013 9:46 am

Batch convert differently sized SVG's to Same Width PNGs

Postby baconCatBug » Mon Jul 01, 2013 9:49 am

Hey all!

I am looking to batch convert a large number (800+) of differently sized and aspect ratioed svg's into pngs. I would like to export them all so they are 300 pixels wide, with the hight being whatever it needs to be to keep the aspect ratio the same. All of the tutorials and GUI's I have found have been to export to a fixed hight and width.

Is there any way I can easily do this? Or will I need to edit all the SVG's to have transparent squares around them and crop the transparency after they are converted?

Edit: In the week it took this topic to be approved, I found the answer.

Code: Select all

for %%i in (*.svg) do "C:\Program Files (x86)\Inkscape\inkscape.exe" -f "%%i" -e "%%i".png --export-width=300

Return to “Help with using Inkscape”