title: Print page using html2canvas
body: <p>I'm building a print page function on my web using <code>html2canvas</code>.</p>
  
  <pre><code>function printthispage() {
  
      html2canvas($("#mydiv"), {
          onrendered: function (canvas) {
              var myImage = canvas.toDataURL("image/png");
              var printWindow = window.open(myImage);                        
              printWindow.document.close();
              printWindow.focus();
              printWindow.print();
              printWindow.close();
          }
      });
  }
  </code></pre>
  
  <p>However the window opened and closed immediately. I've tried removing <code>close()</code>, the image showed on new window but no print function was triggered. Is there something wrong?</p>