Skip to main content
Inspiring
April 4, 2024
Answered

SVG export format completely changed with Illustrator 28.4

  • April 4, 2024
  • 9 replies
  • 9789 views

[update August 2, 2024]

 

With Illustrator 28.6, Adobe again changed the SVG format. They seem to have abandoned the use of `data-name` for complex object ID's.

 

Illustrator 28.4.1-28.5:

 

<rect id="mouse_link_n" data-name="mouse/link/n" class="cls-17"...

 

 

Illustrator 28.6:

 

<rect id="mouse_x2F_link_x2F_n" class="cls-17...

 

 

This is the same as the old format, before 28.4.1. However, the new stylesheet format is still used (.cls-1 etc.).

 

——————————

 

Beginning with Illustrator 28.4, the format of SVG files exported via Javascript are in a very different format.

The following examples are exported with:

 

 

 

options.cssProperties = SVGCSSPropertyLocation.STYLEELEMENTS;
...
doc.exportFile(fileObjSingle, ExportType.SVG, svgOptions);

 

 

 

The AI file looks like this:

 

 

The old format looked like this (Illustrator 28.3):

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 27.9.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xml:space="preserve">
<style type="text/css">
	.st0{clip-path:url(#SVGID_00000050657835777145769900000007173324349283303303_);}
	.st1{fill:#FF000D;}
	.st2{fill:#CA00D5;}
	.st3{fill:#2AEC00;}
	.st4{fill:#F0AB00;}
</style>
<g id="layer_2__x2F__extra_content">
	<g>
		<defs>
			<rect id="SVGID_1_" x="207.75" y="328.25" width="128" height="128"/>
		</defs>
		<clipPath id="SVGID_00000120556236775382720460000010520103355737100182_">
			<use xlink:href="#SVGID_1_"  style="overflow:visible;"/>
		</clipPath>
		<g id="clipped_group" style="clip-path:url(#SVGID_00000120556236775382720460000010520103355737100182_);">
			<rect id="Rectangle_x5F_smaller" x="150" y="270.5" class="st1" width="128" height="128"/>
			<rect id="Rectangle_x5F_Grandé" x="193.5" y="367" class="st2" width="40" height="40"/>
		</g>
	</g>
</g>
<g id="layer_1_200_x25_">
	<g id="group_1__x3E__group_2">
		<rect x="37.5" y="33.5" class="st3" width="116.5" height="116.5"/>
		<rect x="106.25" y="102.25" class="st4" width="116.5" height="116.5"/>
	</g>
</g>
</svg>

 

 

 

The new format looks like this (Illustrator 28.4 & 28.4.1):

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 500 500">
  <defs>
    <style>
      .cls-1 {
        clip-path: url(#clippath);
      }

      .cls-2 {
        fill: none;
      }

      .cls-2, .cls-3, .cls-4, .cls-5, .cls-6 {
        stroke-width: 0px;
      }

      .cls-3 {
        fill: #f0ab00;
      }

      .cls-4 {
        fill: #ff000d;
      }

      .cls-5 {
        fill: #2aec00;
      }

      .cls-6 {
        fill: #ca00d5;
      }
    </style>
    <clipPath id="clippath">
      <rect class="cls-2" x="207.75" y="328.25" width="128" height="128"/>
    </clipPath>
  </defs>
  <g id="layer_2_extra_content" data-name="layer 2 / extra content">
    <g class="cls-1">
      <g id="clipped_group" data-name="clipped group">
        <rect id="Rectangle_smaller" class="cls-4" x="150" y="270.5" width="128" height="128"/>
        <rect id="Rectangle_grandé" class="cls-6" x="193.5" y="367" width="40" height="40"/>
      </g>
    </g>
  </g>
  <g id="layer_1_200_" data-name="layer 1 200%">
    <g id="group_1_group_2" data-name="group 1 &amp;gt; group 2">
      <rect class="cls-5" x="37.5" y="33.5" width="116.5" height="116.5"/>
      <rect class="cls-3" x="106.25" y="102.25" width="116.5" height="116.5"/>
    </g>
  </g>
</svg>

 

 

 

There are many many changes:

 

  • the style definitions
  • ID's now strip out characters like / or < instead of replacing them with entities
  • the original names are included via data-name tags
  • the comment from the 2nd line is now gone
  • clipping paths are handled differently

 

I have built a complex program over many years that depends on the previous format, and it is now completely broken.

 

Does anyone know how to get back the previous SVG export format?

Does anyone know if this is a bug that will be fixed?

 

I have filed a bug report with Adobe.

Correct answer Doug A Roberts

Thanks for providing a definitive answer.


I've been notified that Beta 28.6 54 includes the following changes to Save As SVG:

  1. ID generation for node IDs have been reverted to the original logic (I believe this affects entities in IDs)
  2. The 'Generator' comment has been added back in.

 

If you have a chance to test the Beta and share your thoughts I'm sure the team would appreciate it.

9 replies

New Participant
October 17, 2024

I have been experenced the same issue as well. 

 

Previous version's export feature will create a SVG file with much clear code.

 

  <g id="Bas_Rhin" data-name="Bas Rhin">

            <path id="_29" data-name="29" class="cls-8" d="m678.824,1122..006Z"/>

            <path id="_28" data-name="28" class="cls-8" d="m771.857,697…1.219Z"/>

   </g>

 

But with the upgrade, I found the "data-name" has been removed

  <g id="Names">

        <path  id="_x31__Languedoc" class="cls-30" transform="translate(1915.202 …

</path>

      </g>

New Participant
October 17, 2024

After I upgrade to v29.0, the data-name is back. 

New Participant
July 8, 2024

This issue has significantly disrupted our company's daily workflow, which has been standardized for nearly 10 years. We have an application that utilizes thousands of SVG files, each containing layers labeled with Color IDs that are now being renamed upon export. Unfortunately, the beta version has not resolved this problem for us. As a result, we have issued an alert advising our team to either not update or revert back to version 28.3 until we find a better solution.

New Participant
July 8, 2024

We don't have thousands, but hundreds, and have the same problem. The only thing we could do as a software company was to write a post-processor application to rework the SVGs. It's a major pain and Adobe's position on this is cofounding. It also reduces our confidence in the product, and we have to assume this will break yet again.

 

Participating Frequently
July 8, 2024

We also don't have thousands, but we have enough that this causes a disruption in work flow for us too. Why not just use the W3C standard? Adobe doesn't own SVG, it's an open file type meant for collaboration, not for Adobe to try and build a moat around.
We fortunately have a cooperative group on the production end of signage and have been able to jetison Adobe from that process completely. So their attempt to build a moat has ironically backfired for about half our work which will not use Adobe products moving forward. Given all that privacy stuff that was kicked up last month, probably for the best anyway.

New Participant
June 21, 2024

This also hugely effects my work. Did anyone find a work around for this? I have been just downloading the SVG Code from the preview when you save as. But it is still scrambling some of the way we name things. This hugely effects our software.

Participating Frequently
May 25, 2024

This has broken all of our cnc operations and cut processes. We've had to start using inkscape in stead... ugh. Our CNC won't even recognize a SVG file that is opened and then ctrl-S is used to save with no changes lol.... tell me it's "helpful" with those Adobe responses.

Participating Frequently
May 25, 2024

I downloaded illustrator beta and that has fixed it, but I had to rebuild all my workspaces and that is such a pain. 

Participating Frequently
May 16, 2024

This is also presenting a huge issue for me. It is no longer correctly preserving the svg format needed for our application. I've reverted back to a previous version but will definitely need a different longer term solution. 

New Participant
May 16, 2024

Adobe's stance on this issue is troubling. It's not like the change makes things better (for users, at least). Having more control over the SVG output is a good thing instead of forcing us into a simplified or "dumbed down" export format.

New Participant
May 15, 2024

This has also broken my workflow.

I used to be able to embed class names based on the Graphical Styles applied to the elements. Now Illustrator embeds generic cls-x formatted classes in the CSS.

Why would such a breaking change be done? Why not just include the previous options instead of making it a dumb export with practically zero customization.

Doug A Roberts
Community Expert
May 16, 2024
quote

This has also broken my workflow.

I used to be able to embed class names based on the Graphical Styles applied to the elements


By @John37426380jlba

 

Can you share your Save As options? I get class names from graphic styles when using the 'Style Elements' option in 28.4.1:

 

Community Expert
April 10, 2024

I think SVG files exported using the Save As command have been altered as well.

In my workplace I have to use SVG files for cut-only operations using a Graphtec vinyl plotter/cutter. The SVG files are brought into Onyx Thrive Cut Server. Previously the SVG version 1.1 files with default settings worked properly. The same settings don't work using the latest build of Illustrator. Onyx has next to nothing in terms of documentation for proper SVG export settings, much less what kinds of details should be in the XML code. Onyx has lots of documentation and tutorials for print and cut jobs using PDF files, which makes the lack of info on SVG for cut-only work even more frustrating.

Earlier this week I had to make cut files for a window graphics design spanning a store front's windows (7 foot tall by 23 foot wide design using speciality vinyl that looks like etched glass). No combination of settings using SVG 1.1 would work. I finally found a combination of settings that would work using the SVG Tiny 1.1 format.

Inspiring
April 11, 2024

When I tried saving from the UI, I got the old format. I'll check again.

Doug A Roberts
Community Expert
April 11, 2024

I meant please share your settings in the UI.

New Participant
April 10, 2024

I don't see anything about it in their update notes, either. It has put a wrench in what I do on the daily at work.

Doug A Roberts
Community Expert
April 10, 2024

I've been informed that the Save As SVG code has been brought in line with that from Export As.

Exporting SVG via script until now used the Save As code, so this too has changed.

Doug A Roberts
Community Expert
April 15, 2024

Have you been able to ask to share more information?

 

I am looking at a month of work to rewrite code if this change will not be reverted.

I assume that this is the case, but it would be nice to be sure.

 

Also, thanks — I really appreciate your responses!


The change will not be reverted -- I believe the SVG code from 'Save As' has been seen as legacy for some time.

Doug A Roberts
Community Expert
April 4, 2024

What's the definition of the svgOptions var?

Do you see the same difference if you export via the UI?

Inspiring
April 4, 2024

The svg Options var contains options.cssProperties = SVGCSSPropertyLocation.STYLEELEMENTS;

 

If I export with the UI, I get the old format, with st0 etc. for the style elements.

 

I have tried the newer ExportType.WOSVG, and the output is the newer format with cls- style definitions.

 

Interestingly, the PREVIOUS version of Illustrator also exports the newer cls- style definitions with WOSVG.

 

It makes me wonder if the change is a move to harmonize the output.

Doug A Roberts
Community Expert
April 4, 2024
quote

If I export with the UI, I get the old format, with st0 etc. for the style elements.


By @Andy Swift

 

With which SVG options? Using Export or Save As?

 

Strangely, SVGCSSPropertyLocation uses the CSS options from the UI Save As, not Export As (i.e. ENTITIES, STYLEATTRIBUTES, PRESENTATIONATTRIBUTES, STYLEELEMENTS).

 

Export As only has Internal CSS, Inline Style, and Presentation Attributes.