Table of Contents
Updated for v0.47.
Inkscape has the ability to batch process SVG files without opening up the Graphics User Interface (GUI). The available options can be divided into a few categories: general commands, exporting commands (including printing), and query commands. As of v0.47, Inkscape will also open PDF files from the command line. The first page in the PDF is imported.
Most Inkscape commands are attached to verbs. Any
verb can be called from the command line with the
--verb argument, allowing complex processing to
take place. However, it is not possible to set parameters. A list
of all verbs can be obtained using
does not appear possible to suppress the GUI when using the
Here is a simple example of opening a file, selecting an object, flipping it, and then saving the file. The Star has an id of “MyStar”.
inkscape --select=MyStar --verb ObjectFlipVertically --verb FileSave --verb FileClose MyStar.svg
Most options have two forms: a short form preceded by one dash and
a long form proceeded by two dashes. Some options take parameters
that can (usually) be attached to the option with an = sign
--export-png=my.png) or separated by a space
New in v0.47:
Inkscape now has a shell mode,
entered by calling Inkscape from the command line with
--shell option. There are no new
capabilities using this command; it is simply to allow
one to execute multiple independent commands without
restarting Inkscape each time. Here is an example
of exporting the
MyStar.svg to a
Inkscape 0.47 interactive shell mode. Type 'quit' to quit.
Background RRGGBBAA: ffffff00
Area 0:0:150:150 exported to 150 x 150 pixels (90 dpi)
Bitmap saved as: MyStar.png
|© 2005-2010 Tavmjong Bah.||Get the Book or PDF.|