title: React pdf export is not working consistently
body: <p>I'm trying to export reports on my page. I’ve tried to use 2 diffrent libraries jspdf and react-to-pdf, Both are not working consistently. In both libraries you must put a ref on div and it will convert to img to pdf. its converting but, if i press 10 time to export pdf button it'll give me 10 different pdfs that not looks the same. This is my export pdf buttons, this one is using react-to-pdf library :</p>
  <pre><code>&lt;Pdf targetRef={this.ref} filename=&quot;reacToPdf.pdf&quot; scale={0.7}&gt;
       {({ toPdf }) =&gt; &lt;Button color='grey' onClick={toPdf}&gt;Export PDF&lt;/Button&gt;}
  &lt;/Pdf&gt;
  </code></pre>
  <p>This one is using jspdf :</p>
  <pre><code>&lt;Button color='grey' onClick={() =&gt; {
       const div = document.getElementById('exportPdfDiv')
       html2canvas(div)
          .then((canvas)=&gt; {
               const imgData = canvas.toDataURL('image/png');
               const pdf = new jsPDF('p', 'pt');
               pdf.addImage(imgData, 'PNG', 0, 0, 0, 0, undefined, false);
               pdf.save(&quot;jspdf.pdf&quot;);
               })
          }
      }&gt;Export PDF 2&lt;/Button&gt;
  </code></pre>
  <p>react-to-pdf library 3 diffrent pdf <a href="https://i.stack.imgur.com/yaYag.png" rel="nofollow noreferrer">1</a> <a href="https://i.stack.imgur.com/M9tSx.png" rel="nofollow noreferrer">2</a> <a href="https://i.stack.imgur.com/q1lA9.png" rel="nofollow noreferrer">3</a>
  jspdf library 3 difrrent pdf <a href="https://i.stack.imgur.com/8KmRC.png" rel="nofollow noreferrer">1</a> <a href="https://i.stack.imgur.com/CtsmH.png" rel="nofollow noreferrer">2</a> <a href="https://i.stack.imgur.com/CbihB.png" rel="nofollow noreferrer">3</a></p>
  <p>As you can see each of them has a diffrent position without changing anything in code. the right pdf is should be like <a href="https://i.stack.imgur.com/IRcZC.png" rel="nofollow noreferrer">this</a> one.</p>