title: How to download HTML page as an Image?
body: <p>I am able to download content of HTML page but page contain image of QR code, which is not visible in my downloaded image instead of that I am getting blank space</p>
  
  <p>My HTML and jQuery code is in the following <strong>fiddle</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://files.codepedia.info/uploads/iScripts/html2canvas.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="html-content-holder" align="center" style="background-color:lightcyan; color:black; width: 500px;
          padding-left: 25px; padding-top: 10px;"&gt;
    &lt;div id="content"&gt;
      &lt;form method="post" id="qrForm"&gt;
  
        &lt;center&gt;
          &lt;h4 style="color:red"&gt;Generate QR Code using Google Chart API&lt;/h4&gt;
          &lt;br&gt;
          &lt;b&gt;Type Website URL:&lt;/b&gt;
  
  
          &lt;!--Create TextBox Code--&gt;
          &lt;input type="text" id="QRCode" value="https://www.google.com" size="25"&gt;
          &lt;br&gt;&lt;br&gt;
  
          &lt;h3&gt;Output QR Image:&lt;/h3&gt; &lt;img id='qrImage' style='display:inline;' src="Images/chart.png" /&gt;
  
          &lt;img id="embedImage" /&gt;
  
          &lt;img id="embedImage" /&gt;
  
          &lt;!--&lt;!--&lt;!--   Create Button Code--&gt;
          &lt;center&gt;
            &lt;input type="button" value="Make QR Code" onclick="javascript: generateQRCode();"&gt;
          &lt;/center&gt;
  
        &lt;/center&gt;
  
        &lt;center&gt;
          &lt;a id="btn-Convert-Html2Image" href="#"&gt;Download QR Png&lt;/a&gt;
          &lt;br /&gt;
  
          &lt;!--Print Preview Img In this Div--&gt;
  
          &lt;h3&gt;Preview :&lt;/h3&gt;
          &lt;div id="previewImage"&gt;
          &lt;/div&gt;
        &lt;/center&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;script&gt;
    //Generate QR Code Function
  
    function generateQRCode() {
      this.qrImage.style.display = 'none';
  
  
      //GoogleAPI + TextBox Value= Create QR Image.
      this.qrImage.src = "https://chart.googleapis.com/chart?cht=qr&amp;choe=UTF-8&amp;chs=150x150&amp;chl=" +
        encodeURIComponent(QRCode.value.trim());
      this.qrImage.style.display = 'inline';
  
  
      //Convert Html To Png
      var element = $("#html-content-holder"); // global variable
      var getCanvas; // global variable
  
      html2canvas(element, {
        onrendered: function(canvas) {
          $("#QRCanvas").append(canvas);
          getCanvas = canvas;
        }
      });
  
      //jQuery: Download HTML to IMAGE
      $("#btn-Convert-Html2Image").on('click', function() {
        var imgageData = getCanvas.toDataURL("image/png");
  
        // Now browser starts downloading it instead of just showing it
        var newData = imgageData.replace(/^data:image\/png/, "data:application/octet-stream" + "Image/chart.png");
        $("#btn-Convert-Html2Image").attr("download", "QRCodeImage.png").attr("href", newData);
        //&lt;img class="preload_img" src="../../dbfhrael6egb5.cloudfront.net/wp-content/themes/qr/img-V2/modal/download_preloader.gif"/&gt;
      });
    }
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>