Skip to main content
KitSynthPunk
Inspiring
September 17, 2020
Answered

Locking elements in generated SVG XML

  • September 17, 2020
  • 1 reply
  • 1011 views

I wrote a Lucee/CF application that generates SVG XML. The SVG my application generates imports beautifully into Illustrator 24.3. When I lock some objects in my imported SVG document in Illustrator, and then save the document back out as SVG, I can open the new SVG document, and Illustrator correctly recalls all of my locked objects. But I see nothing in the SVG XML that was saved by Illustrator that would indicate which objects are locked. Is the locked state of objects in documents that are saved as SVG stored in some other form or location in the document other than the SVG XML which I can read when opening the saved SVG document in a program like VS Code? Inversely, is there any way that I can specify in the SVG XML my application generates that certain objects are to be locked when Illustrator imports it?

This topic has been closed for replies.
Correct answer Monika Gause

"Preserve Illustrator editing" saves a full AI file into your SVG. So when opening the SVG, Illustrator opens that and ignores the SVG part. So of course you see all the correct stuff in Illustrator. The SVG is only visible to the outside.

1 reply

Monika Gause
Community Expert
Community Expert
September 17, 2020

The SVG file format in Illustrator is not meant for round-tripping. If it works, then fine, but there's no guarantee.

Which options do you select when saving the SVG file?

KitSynthPunk
Inspiring
September 25, 2020

Here are the SVG Options I use when saving back out to SVG.

Monika Gause
Community Expert
Monika GauseCommunity ExpertCorrect answer
Community Expert
September 25, 2020

"Preserve Illustrator editing" saves a full AI file into your SVG. So when opening the SVG, Illustrator opens that and ignores the SVG part. So of course you see all the correct stuff in Illustrator. The SVG is only visible to the outside.