Hi,
I use Inkscape via CLI with the PHP system command to create unique SVGs within a headless GUI. I use PHP to create a base SVG with unique text/variables (like a mail-merge), and then use Inkscape CLI verbs to complete actions and save out the "rendered" SVG.
Here is the issue. It is slow. 3 seconds per render. My entire database of data for the unique 30,000 SVGs to be created takes 24+ hours to render. Each SVG file creation requires an Inkscape to be launched and closed. This appears to only happen on 1 CPU core. I have 8 cores.
Can I launch 8 Inkscapes at the same time using pthreads? Or will Inkscape freak out?
Any help is much appreciated.
Regards,
Wyatt
Can multiple Inkscapes be launched at same time via PHP pthreads?
Re: Can multiple Inkscapes be launched at same time via PHP pthreads?
Have you tried using the shell mode?
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)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Can multiple Inkscapes be launched at same time via PHP pthreads?
Wow. I did not realize this existed. Very cool.
Hmmm. Curious. I have never done anything like this before.
If I run the following within PHP it will execute the shell and then just hang, as it waits for further instructions.
system("inkscape --shell");
How do I keep sending it verb commands in sequence from my PHP script?
Any help is very much appreciated.
Regards,
Wyatt
Hmmm. Curious. I have never done anything like this before.
If I run the following within PHP it will execute the shell and then just hang, as it waits for further instructions.
system("inkscape --shell");
How do I keep sending it verb commands in sequence from my PHP script?
Any help is very much appreciated.
Regards,
Wyatt
Re: Can multiple Inkscapes be launched at same time via PHP pthreads?
Hmm. I don't think Inkscape --shell can accept verb commands, as the verb commands require a GUI.
Re: Can multiple Inkscapes be launched at same time via PHP pthreads?
Have you tried it? The man page doesn't say anything about the shell mode not working with gui, and indeed, it works.
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)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)