I am using jspdf to convert an image into a PDF.
I have converted the image into a URI using base64encode. But the problem is that there are no errors or warnings sh
No need to add any extra base64 library. Simple 5 line solution -
var img = new Image(); img.src = path.resolve('sample.jpg'); var doc = new jsPDF('p', 'mm', 'a3'); // optional parameters doc.addImage(img, 'JPEG', 1, 2); doc.save("new.pdf");