JSPdf not loading issue when trying to upload image

I have created a pdf format with JsPdf and I want to add an image in it. When I try to add the same pictures to any blank pdf, the pictures are added correctly, but when I load them into the pdf I am using, there is a problem with the pictures loading.

I am attaching the images like this:

var logo = document.getElementById("logo").src;
console.log(logo);
doc.addImage(logo, "PNG", 5, 2, 20, 10);

pdf size before adding image: 187 KB after adding : 3.171 KB

How can I add these images here?

Back to Top