I have an SVG file coming from Inkscape, Illustrator, or any other application. I want to convert the shapes to lineto
, moveto
, curveto
format.
What I want is something like:
./Appname svgfile outfilewithpath
I will give the SVG file as an argument, then my application will convert the object into the respective paths.
This is what finally worked for me:
It takes about 9 seconds to run and briefly opens the inkscape gui, which becomes the active application, so it's not ideal, but it's the only answer I could find that actually works.
Inkscape has a command-line interface. Use the Inkscape man page along with the verb source for reference:
The
ObjectToPath
verb converts an object to a path:The
export-text-to-path
argument converts text nodes to paths:These are related questions on how to run InkScape from Perl, Ruby, PHP or Python: