Change several text spans from the command line

Asked by pbhj on 2017-10-22

I'm making a voucher and want to be able to change text elements from the command line, all I need to alter is a couple of short texts, like a date field, name, etc.. Then output the result as pdf (which will be attached to an email and sent to a remote user).

What's the best way to alter the text programmatically?

I'll know the tspan ids of the parts that I wish to alter, so is there an xml aware stream editor or something along those lines? Or is it best to put in placeholder texts and use sed? Or perhaps I'm better off with python, or bash, or ...

Anyone done/doing this at present?

Thanks.

PS: I'm thinking it would be good to do a little app (maybe "inksed") that searches through for placeholders like ##0##, ##1##, etc. and swaps them for texts entered in a command:
    inksed "Larry" "last date is Tuesday" "Critical" "$500,000" -o larry.pdf

Question information

Language:
English Edit question
Status:
Answered
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Last query:
2017-10-22
Last reply:
2017-10-23
Hachmann (marenhachmann) said : #1

Try the generator extension:
http://wiki.inkscape.org/wiki/index.php/Extension_repository#Generator

(if you're on Linux, that is, or are somehow able to run shell scripts on Windows)

Can you help with this problem?

Provide an answer of your own, or ask pbhj for more information if necessary.

To post a message you must log in.