Removing transforms in SVG files

Ephemera picture Ephemera · Nov 11, 2012 · Viewed 69.5k times · Source

I have been struggling with this for a while, and can't seem to find an answer (that works) anywhere. I have an SVG file which looks like this:

<svg

   xmlns:dc="http://purl.org/dc/elements/1.1/"
   ...
   width="72.9375"
   height="58.21875"
   ...>
   ...
   <g
     ...
     transform="translate(10.75,-308.96875)"
     style="...">
     <path
       inkscape:connector-curvature="0"
       d="m -10.254587,345.43597 c 0,-1.41732 0.17692,-2.85384 0.5312502,-3.5625 0.70866,-1.41733 2.14518,-2.82259 3.5625,-3.53125 1.41733,-0.70866 2.11392,-0.70867 3.53125,0 1.41732,0.70866 ... z"
       ... />
  </g>
</svg>

I want to remove the transform="..." line but still have my image stay where I've placed it (in InkScape). If I manually remove the transform, the image zips to another part of the screen (as expected), but I need to get rid of the transform altogether and, at the same time, have the image stay exactly where I want it. Is there a way to remove/flatten the transforms into the path coordinates themselves? (The only transforms I have to deal with are translate and scale, no matrices.)

Answer

Serge Seletskyy picture Serge Seletskyy · Jun 12, 2014

How to remove transforms in Inkscape

  1. Open svg file in Inkscape
  2. Go to Edit -> XML Editor
  3. Find "transform" attributes in layers and delete them

How to move all objects altogether without creating another transform attributes

  1. Go to Edit -> Select All in All Layers
  2. Go to Object -> Transform

    In Transform panel

  3. Uncheck Relative move and check Apply to each object separately

  4. Set Horizontal and Vertical values according to your needs and click Apply