3

I used to have a list of commands in a text file like this:

-f ./input1.svg -e ../output1.png -y 0 -w 72
-f ./input2.svg -e ../output2.png -y 0 -w 240

and used to run inkscape --shell < commands.txt.

But I cant figure out how to do that in Inkscape 1.0!

  • 4
    Inkscape 1.0 isn't released yet, you are probably referring to 1.0 beta1 or the current development version. Find instructions for the new command line here: wiki.inkscape.org/wiki/index.php/Release_notes/1.0#Command_Line - and let us know if you figure out how to use it... Here's a possibly related bug report: gitlab.com/inkscape/inkscape/issues/428 – Moini Nov 4 '19 at 12:53
  • 1
    (maybe join the developer chat and try to get hold of one of Tav, ede123 or Mc - they are most likely to know how/if it works) – Moini Nov 4 '19 at 12:54
  • 1
    yea dev chat might be an option. the gitlab issue is actually from me:D – Nicolas Degen Nov 4 '19 at 13:59
1

After the release of Inkscape 1.0, one can now do it this way:


echo "file-open:$INPUT_FILEPATH/$INPUT_FILENAME; export-filename:$DESTINATION; export-width:$NEW_RES; export-do" >> commands.txt

# Repeat above for each file

echo "quit" >> commands.txt

inkscape --shell < commands.txt
rm -f ./commands.txt

0

To just make it work again (not using the --shell mode), you could handle reading your commands.txt outside of inkscape and pass single commands to it. If you use xargs, you could run it even in parallel.

Assumming you have a commands.txt with all arguments in one line per input file, like

--export-filename=test72.png --export-width=72 input.svg
--export-filename=test36.png --export-width=36 input.svg

you could execute them as a batch like this:

cat commands.txt | xargs -P2 -L1 inkscape

-P<number> optional: is the amount of threads you want to run in parallel (using not more than you have cpu cores in your device available is reasonable)

-L1 specifies how many non-empty lines of your input file are passed as arguments to inkscape

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.