title: Export the HTML5 svg tags to image c#
body: <p>I have aspx file and it contain <code>&lt;svg&gt;</code>. i want to save this svg as image. I searched lot but couldn't find proper answer for this.</p>
  
  <p>eg:</p>
  
  <pre><code>&lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          &lt;div&gt;
              &lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="mycanvas"&gt;
                  &lt;rect width="300" height="100" style="fill: rgb(0,0,255); stroke-width: 1; stroke: rgb(0,0,0)" /&gt;
              &lt;/svg&gt;
          &lt;/div&gt;
          &lt;input id="Submit2" type="submit" value="submit2" onclick="test2()" /&gt;
          &lt;asp:Button ID="BtnDotNew" runat="server" Text="Convert" OnClick="BtnDotNew_Click" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>how can i do this?</p>
  
  <p>EDIT:
  I tried as follows:</p>
  
  <pre><code>    function test2() {
          canvg(document.getElementById('drawingArea'), document.getElementById("mycanvas").innerHTML)
  
          canvg('canvas', 'file.svg', { ignoreMouse: true, ignoreAnimation: true })
      }
  </code></pre>
  
  <p>but in this situation <code>document.getElementById("mycanvas").innerHTML</code> value mentioned as <code>undefined</code></p>