Inkscape API Inquiry

Asked by Ivan David Lippens on 2019-09-10

Hi,

Just wondering if it's possible to use Inkscape programmatically.
I want to be able to feed an API, or perhaps a command line type of thing, with design instructions, so that I can mass-create millions of designs.

I would need to then have those designs stored in the cloud, and also connected to an API for another service.
Please let me know if something like this is possible, and direct me to documentation to get started down this path.

Thanks, guys!
Ivan
-

Question information

Language:
English Edit question
Status:
Expired
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Last query:
2019-09-12
Last reply:
2019-09-28
Hachmann (marenhachmann) said : #1

Neither mouse actions nor dialog entries can be added programmatically. All menu entries can be used programmatically, and all extensions can be launched and run with the last used values programmatically.

You might want to use the command line and read the output of 'man inkscape', if you're on an operating system that supports that. Or you could go via Help > Man page inside Inkscape to find the same info online.

Ivan David Lippens (getivan) said : #2

I will take a closer look at this command line "man page" you speak of.
Thanks for that Recommendation.

What I need to be able to do is fill-out a list of sequential commands, which is able to select a font, enter text, affect formatting, and adjust sizing, then export the selection to png, etc.
Thinking an XML or Spreadsheet file could be used to build and populate information, and then it gets fed, somehow to an Ubuntu VPS that has Inkscape ready-to-go.

Anyways, thanks for the tip!
I'll dig deeper! :)

Hachmann (marenhachmann) said : #3

Given that description, I think what you want is write an extension.

There exists a similar one already, which is called 'ink-generator' and available from Ubuntu repositories.

It doesn't do resizing, so you can either fix it up yourself, or - what I would recommend - set this up in Python instead, and use the interface that extensions provide in Inkscape 1.0 (not released yet, but more future proof).

Find more info in the release notes draft: http://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#For_extension_writers

Ivan David Lippens (getivan) said : #4

I will have to take a look at Ink-Generator, in that case.
Thanks for that Recommendation.

The Python thing Sounds Good.
Now, just to learn how to code in Python... xD

Launchpad Janitor (janitor) said : #5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.