-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
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');
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.debug.js"></script>
https://drive.google.com/file/d/0BzRwV-8m4H86VHpFS1VFVFU4OWs/view
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.
Attachement base64 png string
Please use the attached string in jspdf code imagedata and Also please copy and paste the Base64 string to browser which seems to work fine.
What could be the reason why JSPDF unable to parse this type of base64 strings and other online PNG base64 to image converters seems to parse the String Successfully?
Metadata
Metadata
Assignees
Labels
No labels