title: html and Svg to Canvas javascript
body: <pre><code>&lt;div id="Contents"&gt;
  &lt;div style="float:left;margin-left:10px;"&gt;
  &lt;svg&gt;&lt;/svg&gt;
  &lt;/div&gt;
  &lt;div style="float:left;margin-left:10px;"&gt;
  &lt;svg&gt;&lt;/svg&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my html code. I want to convert it canvas image.</p>
  
  <pre><code>html2canvas($("#Contents"), {
    onrendered: function(canvas) {
     window.open(canvas.toDataURL());
  
    }
  });
  </code></pre>
  
  <p>I use html2canvas plugin for convert it to image but It does not show svg. 
  I solve converting svg tp canvas but now html2canvas not working</p>
  
  <pre><code>  var $to=$("#MainContents").clone();
  
              $($to).children(".box").each(function() {
      var svg = ResizeArray[$(this).children(".box-content").children().attr("new-id")-1].svg();
              var Thiscanvas = document.createElement("canvas");
              Thiscanvas.setAttribute("style", "height:" + 100 + "px;width:" + 100+ "px;");
  
              canvg(Thiscanvas, svg);
  
              $(this).append(Thiscanvas);
  
          });
          html2canvas($($to), {
        onrendered: function(canvasq) {
          var w=window.open(canvasq.toDataURL());
          w.print();
        }
      });
  </code></pre>
  
  <p>I can convert svg to canvas but html2canvas function not working.</p>