title: JSPDF and html2canvas with Angular
body: <p>I am trying to generate a PDF with html2canvas but when calling the function I throw an error, my TS is the following:</p>
  
  <pre><code>  @ViewChild('content') content:ElementRef;
  
    generarPDF() {
      html2canvas(document.getElementById('content'), {
        // Opciones
        allowTaint: true,
        useCORS: false,
        // Calidad del PDF
        scale: 1
      }).then(function(canvas) {
        var img = canvas.toDataURL("image/png");
        var doc = new jsPDF();
        doc.addImage(img,'PNG',7, 20, 195, 105);
        doc.save('postres.pdf');
      });
    }
  </code></pre>
  
  <p>My html is:</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-css lang-css prettyprint-override"><code>div.cliente {
      border-bottom: 2px dotted;
      width: 70%;
      float: left;
  }
  
  div.fecha {
      border-bottom: 2px dotted;
      width: 28%;
      float: right;
  }
  
  ul.satisfacion {
      float: left;
      margin-top: 28px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;div #content id="content"&gt;
      &lt;div class="contenido-pdf"&gt;
       
        &lt;div class="cliente"&gt;
          &lt;span&gt;Cliente: &lt;/span&gt;
          &lt;div class="campo"&gt;&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="fecha"&gt;
            &lt;span&gt;Fecha: &lt;/span&gt;
            &lt;div class="campo"&gt;&lt;/div&gt;
          &lt;/div&gt;
        &lt;ul class="satisfacion"&gt;
          &lt;li&gt;El servicio es muy satisfactorio&lt;/li&gt;
          &lt;li&gt;El servicio es satisfactorio&lt;/li&gt;
          &lt;li&gt;El servico es normal&lt;/li&gt;
          &lt;li&gt;El servicio no es satisfactorio&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;button mat-raised-button (click)="generarPDF()" id="donwloadpdf"&gt;
    DESCARGAR CARTA DE CONFORMIDAD
  &lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And my error</p>
  
  <pre><code>ERROR Error: "Uncaught (in promise): Error: Supplied Data is not a valid base64-String jsPDF.convertStringToImageData 
  e.convertStringToImageData
  </code></pre>
  
  <p>When I am going to click on generate pdf it does not generate it or do anything, it just throws that error on my console, I already tried to generate it with jsPDF but the problem is that it does not preserve the styles</p>