Inkscape in Windows Command Line
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.
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”
Double % are for a bat file of course:
De mais! O melhor conteúdo sobre assunto que encontrei até agora. Meus parabéns!