title: Export To Pdf angular 6
body: <p>I want to export my HTML page into pdf using angular 6.
  I have written following code to convert into pdf</p>
  
  <pre><code>let dataPdf = document.getElementById('contentToPrint');
  const pdf = new jspdf('p', 'pt', 'a4');
  pdf.addHTML(document.getElementById('contentToPrint'),()=&gt;{
      pdf.save('web.pdf');
  });
  </code></pre>
  
  <p>Getting Following Error:</p>
  
  <pre><code>core.js:12301 ERROR Error: Supplied Data is not a valid base64-String jsPDF.convertStringToImageData 
      at Object.x.convertStringToImageData (jspdf.min.js:50)
      at Object.x.addImage (jspdf.min.js:50)
      at Object.&lt;anonymous&gt; (jspdf.min.js:188)
      at Object.options.complete (html2canvas.js:2711)
      at start (html2canvas.js:2215)
      at Object._html2canvas.Preload (html2canvas.js:2488)
      at html2canvas.js:2719
      at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
      at Object.onInvokeTask (core.js:13842)
      at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
  </code></pre>