Home Forums DITA and XMetaL Discussion Hello! Why do some SVGs work and not others?? Reply To: Hello! Why do some SVGs work and not others??

Derek Read

Reply to: Hello! Why do some SVGs work and not others??

(what is described below is valid up to an including XMetaL Author Enterprise 6.0)

What it comes down to is this:

1) We embed Internet Explorer in DITA documents when we encounter an that looks like it is referencing an SVG file (matching on href=”*.svg”).
2) The script that embeds IE needs to tell IE where the file is (easy enough) and the size because IE must be told how big to draw itself. IE then loads the SVG and handles it with whatever viewer it has installed, if any.
3) In order to tell IE how big to draw itself we have a script that opens the SVG file as XML and parses it to extract the width and height attributes from the element. If these are not present then the image defaults to 200px square. The way this script is currently written also assumes these values are set in pixels and that they do not specify the units. If the units are specified then this sizing will also fail as no attempts to do unit conversion have been implemented.

So, something like the following will render at the proper size:

[code]

[/code]

For the following you'll see a 200 x 200 area:

[code]

[/code]

[code]

[/code]

There are likely possibly many different ways SVG rendering support (in general) can be improved on our side and we're looking into that.

Reply

Products
Downloads
Support