SVGDOCUMENT.OPEN throws invalid xml exception

Dec 10, 2012 at 10:47 PM

I am trying to using the svg.dll to convert the svg document into a png document.

Here's a snippet of my code

Svg.SvgDocument svgDoc = null;
var input = Convert.FromBase64String(svgdocument);
using (var stream = new MemoryStream(input))
{
             
SvgDoc = SvgDocument.Open(stream);             

}

I get an invalid xml exception : Data at the root level is invalid. Line 1, position 1.

Any help in this regard will be useful

 

Thanks in advance

Feb 25, 2013 at 8:28 AM
I've the same problem. Anyone know solution?
Nov 12, 2013 at 7:56 AM
Edited Nov 12, 2013 at 7:59 AM
If you svg data it's on base64, yo need to use this:
byte[] byteBuffer = System.Convert.FromBase64String(svgBase64String);