I’m trying to use jspdf to add an image to a pdf
the code is really straight (I removed all variable trying to identify where the issue is)
const doc = new jsPDF();
base64image= 'data:image/png;base64,iVBORw0KGgoAAAANS......'
var img = new Image()
img.src = base64image
doc.addImage(img, 'png', 10, 10, img.width, img.height)
doc.save(filename);
The issue is that if I run it in the browser, the pdf is created with the image, but once executed on android phone, the image is a mess, seems stretched or something similar (changing size doesnt fix)
I don’t know really what is the problem. Someone can help? thanks
1 post - 1 participant