Is there a way to remove path/group transformations when exporting as SVG with Illustrator? My problem is similar to this one but the given solution is only for Inkscape.
Using Illustrator CC -- After trying several of these tips without success, I was able to finally convert/export to SVG:
No more Transform/Expand errors! Hope this works for others :-)
I'm not sure there's a one-click fix, but I solved the issue when working with simple shapes and paths by using "Unite" button in the Pathfinder pallet. You should actually see the bounding box change rotation as you click it.
However, some primitive shapes (ellipse, rect) were exported by Illustrator with transforms even after applying Unite. I solved this in my project by altering the points of the shape just slightly using the direct select tool.
The key seemed to be getting illustrator to output the svg using a path or polygon tags rather than svg's native rect or ellipse.
Illustrator CC v. 19.2.1
As far as I can tell only rectangles and ellipses will have the 'transform' attribute applied to them...
Here is a simple square:
And here is its relevant bit of code:
<rect x="95" y="95" width="470" height="470" fill="none" stroke="#0f6fa3" stroke-miterlimit="10" stroke-width="24"/>
That's 116 characters.
Here, the same square rotated:
And its code:
<rect x="95" y="95" width="470" height="470" transform="translate(-99.59 147.65) rotate(-22)" fill="none" stroke="#0f6fa3" stroke-miterlimit="10" stroke-width="24"/>
That's 165 characters... Now the same square with a single anchor point added:
<polygon points="635.92 459.86 200.14 635.92 24.08 200.14 142.31 152.38 459.86 24.08 635.92 459.86" fill="none" stroke="#0f6fa3" stroke-miterlimit="10" stroke-width="24"/>
And this last example weighs in at 171 characters...
So it seems that leaving the transform attributes alone may actually be more efficient anyhow...
To remove transforms and keep primitive SVG shapes ( rect, ellipse ):
- Group shapes you want to export
- Then press "Unite"
- Ungroup and export / asset / etc.
If you have overlapping shapes - move them before grouping so they don't overlap, do the procedure, move them back...
If you have only one shape - draw anything next to it, group ... do the procedure ... ungroup and remove anything you don't need, then export.
Without grouping it doesn't work sometimes, but with grouping - works for any shape.
Illustrator CC 19+, haven't tried it in earlier versions.