Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48979

The Ionic capacitor jspdf add image?

$
0
0

Hello,

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
jackyjoy

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>