SVG : Ungroup objects / remove transform from command line

1.2k views Asked by At

Here is an SVG file with some path :

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0"
    ... viewBox="0 0 1920.000000 1080.000000">
    <g transform="translate(0.000000,1080.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
        <path d="M16320 10788 c0 -5 132 -7 293 -6 293 2 259 6 -101 10 -105 2 -192 0
-192 -4z"/>
 <!-- Many other paths -->

I want to extract the paths data within the 1080x1920 reference frame. The translation and scaling have to be considered before extracting path data.
I currently use the Ungroup option in Inkscape before extracting all paths.
How to do it automatically (via command line or programm) ?

1

There are 1 answers

0
Igor Mikushkin On BEST ANSWER

You can run Inkscape actions from the command line

inkscape --actions "select-all:groups; SelectionUnGroup; export-filename: output.svg; export-plain-svg; export-do;" intput.svg