Copy link to clipboard
Copied
There is a problem I am experiencing, that others have discussed here Illustrator retains unsavory namespaces in SVGs, can't open it's own export
Basically the AI document retains namespace data from SVG's that have been copied or used in some way to create the AI.
When the document is saved to SVG - these namespace references remain and can result in invalid SVG output.
Does anyone know of a way that these namespaces could be accessed using Illustrator Scripting?
thanks,
Mochael
Copy link to clipboard
Copied
Not sure about doing it from inside a script, but a script which saves the file and then opens it up as text to remove the unwanted characters, could be possible!
Copy link to clipboard
Copied
Yes I'm already doing that with a regex - I would rather be able to detect and remove those before export.
Copy link to clipboard
Copied
Oh, can you describe how you are able to have such a file? I tried to recreate the problem in the thread by copying and pasting from inkScape, into my AI CC2014, but it did not work- no namespaces were carried over. Opening the file, I got the validation error- so how did you bring this into AI in the first place?
Copy link to clipboard
Copied
I honestly don't know the AI was supplied to me - will try and replicate.
I know it must have been made from an SVG somehow, as it contains namespaces that are injected into the SVG when uploaded to our CMS
Copy link to clipboard
Copied
So is your namespace issue caused by an operation of handling svgs by your CMS, and not the inkscape/sodipodi as in the example thread? Would you be able to paste a problem snippet here?
Copy link to clipboard
Copied
So under certain circumstances when an SVG is uploaded into our CMS data similar to this is added
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="2550px" height="2000px" viewBox="0 2000 2550 2000" enable-background="new 0 2000 2550 2000" xml:space="preserve" xmlns:cib="http://connectib.com/connect">
<path id="outline33" cib:unitID="0" fill="#6FACD3" stroke="#878787" d="M984.7,3258.8l187.2-46.6c0,0,47.1-13.3,64.4,33.4
l-5,153.5c0,0-1.8,73.1-76.4,98.3l-89.6,23.5l-3-9.8l-13.9,2.4l-0.2,4.4l-64.2,15.9l-7-30l-7.5,1.2l-31.2-130l6.1-1.9l-6.3-30.8
l8.9-3.7l-2.2-10.5l31.5-54.2l11.6-3.2L984.7,3258.8z" />
</svg>
If you open that document in Illustrator it's fine, it appears under certain circumstances Illustrator loses the namespace declaration and when you save to SVG you still get the property on the path, but no declaration which makes it invalid.
Copy link to clipboard
Copied
I am unable to open it in CC2014.
Copy link to clipboard
Copied
Oh and now it just crashes my Illustrator.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more