How to display SVG ?

Hi, is there a way to display a Graphic in SVG from a SVG-XML-File ? I have seen some SVG support, but could not find any example of using a SVG-XML-File directly.

Cheers, Rob.

Hi,

With Embedded and setType(TYPE_OBJECT); setMimeType(“image/svg+xml”); things should work just fine on browsers that support svg. Type and mime may be unnecessary if your resource can provide proper meta data.

You could check out how
JFreeChartWrapper
does its magic.

Depending on where your svg files are, you can use e.g. FileResourse, ThemeResourse, ExternalResours to serve the Embedded component.

BTW. I have a half working prototype of a wrapper for
SvgWeb
. If I could get it stable enought, even IE’s would have sharp SVG files rendered (with help of SvgWeb’s flash renderer). Last summer the job stalled due to a bug in SvgWeb. Haven’t checked whether it is fixed already.

cheers,
matti

Thanks Matti, that works.

Maybe you should check out the SvgWeb, they just had a new release which maybe fixed the bug stopping you from coding your wrapper (which would be definitely an interesting thing - let me know, if you continued).

Cheers, Rob.