How to Export Inkscape SVG Files to PNG using the Command Line

Share

It's possible to export the contents of an Inkscape SVG file using command line arguments1. For this, we'd need to do something like this:

"C:\Program Files\Inkscape\bin\inkscape.exe" --export-area-page --export-type="png" my-svg-file.svg

This will automatically create and overwrite without asking a my-svg-file.png. The output filename can be specified with the --export-filename argument.

We can even use a loop to quickly export all SVG files in the current directory:

for %%f in (.\*.svg) do (
    "C:\Program Files\Inkscape\bin\inkscape.exe" --export-area-page --export-type="png" %%f
)

Check Inkscape's wiki for more options.

References

  1. https://wiki.inkscape.org/wiki/Using_the_Command_Line (accessed 2024-06-04) ↩︎

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *