Nicolas De Irisarri
Nicolas De Irisarri

Reputation: 1077

Show SVG files on Sharepoint 2007

I'm building a WSS site which has to show SVG files stored on WSS. I'm trying to use <object> tag to show it and it doesn't show, however, if I use <embed> it works ok. Im'using IE8 and IE7

I've been reading and everyone tells IE prefers <Object> over <embed>, but in WSS it doesn't work this way.

To display the file I'm using a web content editor webpart with this code:

<object type="image/svg+xml" data="/samples/sample.svg"
        name="owMain" width="400" height="150">
</object>

Any clue??

Upvotes: 0

Views: 4128

Answers (5)

lucidware
lucidware

Reputation: 21

I've found that it's not actually necessary to embed SVG as an object.

If you use the SVGWeb JavaScript library, you can actually put your SVG into a normal Content Editor Web Part via the Source Editor, and manipulate the SVG elements via JavaScript.

The library can also work with a referenced SVG file as an object, but I haven't tried that option.

The library is hosted on code.google.com

Upvotes: 2

Nicolas De Irisarri
Nicolas De Irisarri

Reputation: 1077

I managed to do this on IE7/8 with the following Html:

<embed width="600" height="450" id="objMapView" src="http://XXXXXXXX/file.svgz" 
 type="image/svg+xml" name="objMapView" border="1"/>

It works Ok bur requires adobe's SVG Plugin

Upvotes: 0

balexandre
balexandre

Reputation: 75103

Is it me or IE does not support SVG? Well, it kinda does but it is tricky and it's to draw, not to show svg files. ... If you open with FF can you see what you are expecting?


added

I made an svg draw in IE ... it's not the same, I know, but it's something that you can read and test: stackoverflow.com/questions/536676

Upvotes: 0

Jason Weber
Jason Weber

Reputation: 1522

The first step, if you haven't already, is to confirm that the HTML content in the response is as you expect (e.g. view source). If it isn't then you've found your issue. If it is, the next step might be to use a debugging proxy like Fiddler to confirm that all of the related requests are being made and handled as you expect. If they're not then you've found your issue (e.g. security). If they are then by the process of elimination you can safely conclude that either the markup or the browser is lacking.

Upvotes: 1

Nat
Nat

Reputation: 14295

You cannot add object tags to the html content of a page in WSS. The issue is that the object tag can be used in lots of very bad ways, so it is stripped out by the underlying engine.

You have found that the content editor webpart does not suffer from the same limitations.

Upvotes: 1

Related Questions