10

Given the following SVG:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="1891px" height="1492px" viewBox="0 0 1891 1492" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <g transform="translate(352 500)">
        <path d="M1,0 L1,400 C0.999999169,799.99998 201,1205 601,1439.4375 C1001,1205 1201,800 1201,400 L1201,0 L1,0 Z M1,0"></path>
        <path d="M1,0 L1,960.824531 C1.00000084,1439.4375 489.311066,1258.28207 600.483175,1439.4375 C708.904794,1258.28211 1201,1439.4375 1200.99997,960.824531 C1200.99996,960.824531 1201,0 1201,0 L1,0 Z M1,0"></path>
    </g>
</svg>

Are there any tools to automatically update the path points with the transform, and remove the transform from the group element?

I have an SVG app (Sketch) that outputs an SVG using transform attributes (if you make any adjustments to the path), but in my web app I need to actual path points to already be adjusted, and not use any transform attributes.

Clarification: The goal is to find an app or tool that will allow this to be performed on large SVG files, thus removing any transform attributes throughout the entire file.

Thanks!

mike.bronner
  • 1,203
  • 1
  • 20
  • 39
  • 1
    For one-offs that would be fine. I'm looking for an app or command-line tool that will allow me to apply this to very large SVG files, getting rid of all transforms in said file. Thanks, though, for a visualization of the solution. – mike.bronner Oct 29 '13 at 22:04
  • A thing to be aware of is that if you do apply the transform it can change the appearance of that path, e.g the stroking can look different. – Erik Dahlström Oct 30 '13 at 09:02
  • possible duplicate of [apply all transform matrices](http://stackoverflow.com/questions/10126498/apply-all-transform-matrices) – Erik Dahlström Oct 30 '13 at 09:02
  • You can use [Inkscape](https://inkscape.org/en/) or [SVG Cleaner](http://sourceforge.net/projects/svgcleaner/) to do that. See [apply all transform matrices](http://stackoverflow.com/questions/10126498/apply-all-transform-matrices) – cuixiping Aug 28 '15 at 03:02
  • 1
    Possible duplicate of [Removing transforms in SVG files](http://stackoverflow.com/questions/13329125/removing-transforms-in-svg-files) – AAGD Jun 01 '16 at 18:44

1 Answers1

0

There is an Inkscape extension, Apply Transforms, which I have found works well for removing transforms on elements and applying them to the sub-elements (adjusting a <rect>s width and height, for example).

sil
  • 1,769
  • 1
  • 18
  • 34