title: Scale image before toDataURL - html2canvas
body: <p>Before you tell me this is a duplicate question, know that I've searched through <strong>every</strong> single similar question and <strong>none</strong> of the answers in any of them are working for me.</p>
  
  <p>Im using <strong>html2canvas</strong> to grab a snapshot of a div, and what I need to do is scale it up to <strong>750x1050</strong> before saving it to a png via <code>canvas.toDataURL()</code>.</p>
  
  <p>The closest I got was with the following code.</p>
  
  <pre><code>html2canvas(document.getElementById('div_id'), {
     onrendered: function(canvas) {
  
        var extra_canvas = document.createElement("canvas");
  
          extra_canvas.setAttribute('width', 750);
          extra_canvas.setAttribute('height', 1050);
  
          var ctx = extra_canvas.getContext('2d');
          ctx.drawImage(canvas, 0, 0, 750, 1050);
          var dataURL = extra_canvas.toDataURL();
  
          window.open(dataURL);
     }
  });
  </code></pre>
  
  <p>The image was sized properly but the text within the image was extremely poor quality, as if it resized it <strong>after</strong> becoming a png.</p>
  
  <p>Is it that I'm doing something wrong or can you just not scale up this way?</p>
  
  <p>Any and every suggestion/work-around will be greatly appreciated!</p>