Common Reference > Document Class > RenderSvg Method

Document.RenderSvg Method

Return document rendered as SVG.

Overloads

Result

The result of this call is a string representation of an SVG document. This may be written to file as text for inclusion in a webpage, or returned via HTTP with content type “image/svg+xml”.

Most modern browsers (including Microsoft Internet Explorer 9 – 2011) natively support SVG. So not only they will display SVG files save with SaveSvg, but you can also inline the string returned by RenderSvg directly into you HTML body.

For compatibility with older browsers, you can embed the SVG using the <embed> tag :

<embed src="mychart.svg" height=300 width=640 type="image/svg+xml">

Example

  // Render SVG at 96 dots per inch, scaled to fit container width, with pages laid vertically.
   svg = doc.RenderSvg(SvgMode.FitWidth,96,PageMode.Vertical);

See also ...

SharpPlot.RenderSvg Method | SharpLeaf.RenderSvg Method | Document.Members | Document.SaveSvg Method


Send comments on this topic
© Dyalog Ltd 2021