title: Missing images depending on scale in html2canvas (html2pdf)
body: <p>I am trying to make a PDF of a reasonable amount of text and graphs in my html using html2pdf. So far so good, the PDF gets made and it looks fine. It is about 20 pages.
  However, multiple graphs are missing. Some relevant information:</p>
  <ul>
  <li>Most of the missing graphs are at the end of the document. However, the final graph is rendered, so it is not an explicit cut off at the end</li>
  <li>The text accompanying the graphs is there, but the graph itself is not</li>
  <li>The missing graphs are all of the same type. Other graphs of this type are rendered and look fine. It does not seem to be a problem with the type</li>
  <li><strong>If I reduce the scale on the html2canvas configuration to about 0.8, every graph gets rendered</strong> (but of course quality is reduced). I'd like the scale to be 2.</li>
  </ul>
  <p>The fact that scale influences whether they are rendered or not, gives me the idea that something like timing / timeouts are a problem here. Larger scale means obviously longer rendering time, but it does not seem to wait for it to be done. Or something like that.</p>
  <p>Below the majority of the code that makes the PDF.
  The onClone is necessary for the graphs to be rendered correctly. If it is removed, the problem described above still occurs (but the graphs that áre rendered are ugly).</p>
  <pre><code>    const options = {
        filename: 'test.pdf',
        margin: [15, 0, 15, 0],
        image: { type: 'jpeg', quality: 1 }
        html2canvas: {
          scale: 2,
          scrollY: 0,
          onclone: (element) =&gt; {
            const svgElements = element.body.querySelectorAll('svg');
            Array.from(svgElements).forEach((item: any) =&gt; {
              item.setAttribute('width', item.getBoundingClientRect().width.toString());
              item.setAttribute('height', item.getBoundingClientRect().height.toString());
              item.style.width = null;
              item.style.height = null;
            });
          }
        },
        jsPDF: { orientation: 'portrait', format: 'a4' }
      };
  
      setTimeout(() =&gt; {
        const pdfElement = document.getElementById('contentToConvert');
        html2pdf().from(pdfElement).set(options).save()
          .catch((err) =&gt; this.errorHandlerService.handleError(err))
      }, 100);
  </code></pre>