title: html2Canvas vs dom-to-image
body: <p>Working on a project and the function below seems to take a great deal of time to process. I've seen html-to-image being talked up as better alternative although html2Canvas is clearly the most popular. Anyone used both and could confirm which one is faster?</p>
  <pre><code>
    function saveVoucher(name) {
      const canvas = document.querySelector('#voucher');
      const myPromise = new Promise((resolve) =&gt; {
        setIsLoading(true);
        setTimeout(() =&gt; {
          resolve();
        }, 1000);
      });
      myPromise.then(() =&gt; {
        html2Canvas(canvas, {
          scrollY: -window.scrollY,
          scale: 2,
        }).then((canvas) =&gt; {
          setIsLoading(false);
          setIsOpen(true);
          let dataURL = canvas.toDataURL('image/jpeg', 2.0);
          const voucher = new jsPDF({
            unit: 'px',
            format: [185, 240],
          });
          voucher.addImage(dataURL, 'JPEG', 0, 0, 185, 240);
          voucher.save(`${name}.pdf`);
        });
      });
    }```
  </code></pre>