Is there an Inkscape command line tutorial?

Post questions on how to use or achieve an effect in Inkscape.
theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Is there an Inkscape command line tutorial?

Postby theozh » Wed Sep 20, 2017 7:04 pm

I am using Inkscape for a while now. And I am impressed what the developers have put together.
Sometimes, I think the command line option could be a good thing.

However, so far I haven't found much more than:
http://tavmjong.free.fr/INKSCAPE/MANUAL ... dLine.html
Well, flipping a star is already a start... ;-)
On my laptop it's rather slow because it seems that it always has to start the GUI (which I actually don't want to be started...)

However, does anybody know, for example, how to create via command line:
- a new file
- create a square with a certain size (how to enter the size, position, etc.? How to give an ID? ...)
- center it on the canvas
- color it blue
- etc...

I know that you can get the verb-list via

Code: Select all

inkscape --verb-list

Is the command line actually suitable for batch processing?
I get the impression that a batch processing of 100 files and in each file, e.g. changing a blue square named "XYZ" into a red circle named "ABC" might be faster if you do open each file via GUI and edit by hand...

Thank you for any hints or practical examples...
Win7/64, Inkscape 0.92.2

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Is there an Inkscape command line tutorial?

Postby Moini » Thu Sep 21, 2017 12:35 am

I don't know of any tutorials, sorry.

Have you looked at the man page?
(on Linux: man inkscape - on Win: no idea - web page: https://inkscape.org/doc/inkscape-man.html )
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Is there an Inkscape command line tutorial?

Postby Moini » Thu Sep 21, 2017 12:35 am

(it contains examples, too)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Is there an Inkscape command line tutorial?

Postby theozh » Thu Sep 21, 2017 10:29 pm

Thanks @Moini, unfortunately I have Win7 and at the given link, there is not too much enlightening information.
Does the Linux man page have more information?
I already fail to create an empty file named "Test.svg" :-(. Such basic examples are missing...

Code: Select all

inkscape --verb=FileNew --verb=FileSave --verb=FileClose
Does not create a file for me. How and where do I put a name?
Win7/64, Inkscape 0.92.2

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Is there an Inkscape command line tutorial?

Postby Moini » Fri Sep 22, 2017 6:33 am

Creating files and saving them as Inkscape SVG is not supported, as far as I know... No wonder you can't find it...

You could circumvent by exporting to plain SVG:
-l, --export-plain-svg=FILENAME

Or by opening an existing file with the correct name (you can create it programmatically, e.g. by copying another file).

And, another set of features has been added, which has a 'save as' functionality, but works by reading the commands from a file. Old and new commands can be mixed in that file.
wiki.inkscape.org/wiki/index.php/Using_xverbs
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Is there an Inkscape command line tutorial?

Postby brynn » Fri Sep 22, 2017 2:56 pm


theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Is there an Inkscape command line tutorial?

Postby theozh » Fri Sep 22, 2017 6:53 pm

@brynn, I'm pretty sure that the page was completely loaded. And that's all the information which is available.

@Moini, thanks that could be a work around to create a file (actually duplicating one).

Code: Select all

inkscape -f Empty.svg -l Test.svg
Then in a second line you could (theoretically) apply your changes...

HOWEVER, now I read again more carefully on the page:
http://tavmjong.free.fr/INKSCAPE/MANUAL ... dLine.html
"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."

Well, if you really can't set parameters or values, then how should you draw any defined object or shift an object by a defined amount or rotate by an angle other than 90°, set or change the color, etc., etc... ?

Recently, there was a question here about changing objects in a SVG via command line viewtopic.php?f=5&t=32934
Such type of batch modification of SVG files would be ideal for the command line.
And I thought that's what the command line is mainly intended for... but if you can't set parameters... :(

Generally, I'm wondering if these command line options is used by anyone at all?
Well, maybe except certain command line file format conversions, e.g. PDF->SVG, EPS->SVG, SVG->PNG, etc...

I really would be interested in practical examples in the field where command line is used other than for file format conversion.
If anyone use command line on a regular or batch basis, please let me know.
Win7/64, Inkscape 0.92.2

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Is there an Inkscape command line tutorial?

Postby Moini » Sat Sep 23, 2017 3:48 am

Yes, theozh, you cannot use any parameters, except for those mentioned on the man page and on the Xverbs Wiki page.
The command line is mostly for im- and exporting files, and for making the changes that are available via --verb-list.

It would require someone to work on making dialog options available as parameters, and also on the automatical documentation of them. No idea how easy or hard that would be. There are many, many dialogs - but perhaps it would be possible to automatically expose their parameters, or at least some of those - unless there are too many exceptions, and too much functionality linked directly to the dialogs (like automatically adapting other values to the given ones).

Yes, people do use it, also inside extensions (which is the only place where I need it).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Is there an Inkscape command line tutorial?

Postby brynn » Sun Sep 24, 2017 6:01 pm

theozh wrote:Thanks @Moini, unfortunately I have Win7 and at the given link, there is not too much enlightening information.


theozh wrote:@brynn, I'm pretty sure that the page was completely loaded. And that's all the information which is available.


Theozh, are you saying that the info on this page: Basics - Help menu > Tutorials
Manual -
Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Is there an Inkscape command line tutorial?

Postby theozh » Sun Sep 24, 2017 6:52 pm

@brynn, no, the page was not broken or blank, it contains also some useful information.
However, the page was not helpful to me in the sense that I missed the explicit information that "parameters cannot be set via command line".
I always believed it must be somehow possible to create new files and draw objects via command line.
So my original question is kind of solved: There is no explicit tutorial.
And futhermore, the things I wanted to do via command line can't be done (at least not yet).
Win7/64, Inkscape 0.92.2

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Is there an Inkscape command line tutorial?

Postby brynn » Sun Sep 24, 2017 10:06 pm

Thanks for clarifying :D


Return to “Help with using Inkscape”