title: Unable to add base64 png images to JSPDF Javascript
body: <pre><code> function save_pdf() {
   var doc = new jsPDF();  
   var imgSampleData ='data:image/png;base64,/9j/4AAQSkZJRgABAAEA8ADwAAD/2w...';
   doc.addImage(btoa(imgSampleData), 'PNG', 15, 40, 175, 75);
   doc.save('MCR.pdf');
  }
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.debug.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>When I pass base64 strings from one of the webservices I am unable to add these base64s to images of JSPDF below is the error I get in IE</p>
  
  <p><strong><em>Incomplete or corrupt PNG file</em></strong></p>
  
  <p><a href="https://i.stack.imgur.com/qB9a1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qB9a1.png" alt="enter image description here"></a></p>
  
  <p>I have attached entire base64 String of whole image. This Base64 works fine and able to see images if I use any online conversion tool.</p>
  
  <p><a href="https://drive.google.com/file/d/0BzRwV-8m4H86VHpFS1VFVFU4OWs/view?usp=sharing" rel="nofollow noreferrer">Attachement base64 png string</a></p>
  
  <p>What could be the reason why JSPDF unable to parse this type of base64 strings and other seems to parse the String Successfully? </p>