Home > Explanations, Tips > Inkscape in Windows Command Line

Inkscape in Windows Command Line

Inkscape

Inkscape is a great tool to draw excellent pictures, and is open source. Although it has some problems when working in Windows, nevertheless there are plenty solutions.

One of those problems is the command line. In Windows the command line doesn’t give any output because everything is redirected to the stdout and stderr. In the documentation they mention that they are working on it, but there are some solutions already. Is just about wrap Inkscape to other software.

Now that we can see the output when we try to work in batches or simple files you will notice that Inkscape does not produce any results or give some error about the files do not exist. That is because it uses the path of where is installed and not the current directory. To solve this — and avoid writing the full path all the time — we can use the %CD% windows variable which holds the current directory full path. For example to convert the figure.png to eps we will input

inkscape -f "%CD%\figure.png" -E "%CD%\figure.eps"

the inkscape command could be replaced by the command that you use once the Inkscape executable is wrapped to show output, the -f option sets the input file, and the -E option is for set the export as eps file. Note that the %CD% option uses an aditional backslash (‘\’) at the end to create a correct path for the files.

About these ads
  1. ampecs
    January 6, 2013 at 1:59 am | #1

    For me this was useful to export to png all files in this dir :
    for %%x in (*.svg) do C:\Ink\App\Inkscape\inkscape.exe %%x -z –export-dpi=500 –export-area-drawing –export-png=”%%~nx.png”

  2. ampecs
    January 6, 2013 at 2:01 am | #2

    Double % are for a bat file of course:

    ampecs :
    For me this was useful to export to png all files in this dir :
    for %%x in (*.svg) do C:\Ink\App\Inkscape\inkscape.exe %%x -z –export-dpi=500 –export-area-drawing –export-png=”%%~nx.png”

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: