I would like to add text to an SVG template layout and have it flow into the rectangles I have created for it. I would like to do this programmatically.

My initial thought was to use Inkscape and D3.js however Inkscape 1.1 creates tspan objects for flowed text inside text objects and the positions of these seem to be calculated individually. Unless I recreate those calculations in my code (difficult) I don't see how I can flow the text.

Any suggestions as to how this may be achieved?

  • Programming questions are generally off-topic here. Sorry about that. Maybe try Stack Overflow.
    – Billy Kerr
    Aug 25, 2021 at 11:28
  • 1
    I was wondering. It sort of falls into that space between design and programming. Add enterprise architecture into the mix (the content) and it is a problem that has a really weird mix of specialties. Aug 25, 2021 at 22:49

1 Answer 1


You can use Inkscape without GUI from the command line. Simply opening and re-exporting the file seems to recalculate flowed text:

inkscape -o ./output.svg ./input.svg

or piping from stdin to stdout:

... | inkscape -p -o - | ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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