title: jsPDF : Black rectangular box appears when using addimage on node.js
body: <p>I am working on an electron.js application where I am creating PDFs using jsPDF on the server side.</p>
  
  <p>Its working as expected except the addimage property.
  It creates a rectangular black box in place of image in PDF.</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-js lang-js prettyprint-override"><code>global.PNG = require('png-js');
  global.window = {document: {createElementNS: () =&gt; {return {}} }};
  global.navigator = {};
  global.atob = require('atob');
  
  const jsPDF = require('jspdf');
  let doc = new jsPDF();
  
  
  let imgData = 'data:image/jpeg;base64,.................'
  doc.addImage(imgData, 'PNG', 80, 10,50,15);
  
  let data = doc.output();
  fs.writeFileSync(folderPath, data);
  
  
  
  
  delete global.window;
  delete global.navigator;
  delete global.btoa;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/Slqka.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Slqka.png" alt="enter image description here"></a></p>
  
  <p>The same base64 image works in client side jsPDF, but not in node.js.</p>