Strange problem with IE and SVG[Adobe Svg].

By ealis

I know,  I know, . .  Adobe has pulled support for SVG, but most of my work involve with this two combo. IE and AdobeSVG.

I’ve been playing around with Sharepoint for most of the week, so today I tried pulling an asp generated SVG from my EALIS IIS server. I used one of the webpart that allows you to put custom HTML onto the webpart. Created an embed tag with a source pointing to an asp code that spits out svg. Defined the type to “image/svg+xml” as I always do.

<embed src=”http://ealis/svgGenerator.asp?parameter” type=”image/svg+xml” />

Publish it [using ie], just blank. Check the html, repubish again, still nothing on the page. Then I tried loading the page from Chrome, SVG loads just fine. Huh. Fire up Firefox, SVG load just fine like Chrome. The same goes with Opera and Safari. Damnn.

At this point I’m not sure what’s the real problem. Is it adobe svg, ie, iis or my asp code. I was almost certain it must have somthing to do with ie+adobesvg.

The other day I faced a problem on IE on one of my asp-SVG when my url string exceeds 2048 characters. The funny thing was it work just fine on all the other browsers. It seems that only IE apply that 2048 characters limit. But here the url string is shorter than 2048 so it’s legit. The svg will load just fine if I point the browser directly to:

http://ealis/svgGenerator.asp?parameter

So I decided to look further into this. I tried to create a local html on my desktop [not through IIS] and put the same embed line inside this local html file, and load it with IE. SVG doesn’t load, even adobeSVG is not firing. It work just fine in all the other Browser.

  • <embed> svg:from IIS on other server type:image/svg+xml >> IE fail [other OK]
  • <embed> svg:local svg with .svg extension type:image/svg+xml >> OK all
  • <embed> svg:local svg with .svg extension type:nomime >> OK all
  • <embed> svg:local svg with .txt extension type:image/svg+xml >> OK all
  • <embed> svg:local svg with .txt extension type:nomime >> fail All

So I have to look into IIS as this was the only time when IE+AdobeSVG shows a different result from all of the other. So I placed a html into on of our DB server [not ealis, not sharepoint] with an embed tag pointing to the asp-svg generator just like the webpart I edited in sharepoint. As expected the same effect/bug happens again. In IE nothing shown but on all the other browser SVG load just fine. So for sure it’s not just IE+adobeSVG, it must have something to do with server side as well.

Then I made a copy of the asp-SVG generator into the DB IIS so that the generator runs form locally on this isolated server. Low and behold it loads just FINE!! in IE. So in order for asp-SVG to be loaded in IE by using an embed tag, the asp code has to be placed inside the same iis server as the server where the embed tag came from. So this in a way wreck my idea of having SVG content from ealis pushed into our Sharepoint.

I tried playing around with my header definition in my asp code

  • response.addheader “Content-Type”, “image/svg+xml”
  • response.contenttype = “image/svg+xml”

This seems only to have an effect when you point the browser directly to the asp page. Looked around the net on embeding SVG to html, found out that one can use Iframe as well, so changed from embed to Iframe, and it worked on all of the browsers. Damn. This seems to be the best solution. But the way I’ve written code for all the other function I’ve written, it was under the model/assumption where an embed tag is in place. I’ll need some reworking. But for now IFrame is good enough.

I don’t know whether I’ve stumbled upon a bug, even If I stumble upon something I’m not sure what exactly went wrong, I don’t know which part went wrong, even if I managed to pinpoint the weakest link, I am about 7 month too late, Adobe has stopped support on adobeSVG.

Leave a Reply