var img = new Image();
img.src = "data:image/jpeg;base64,/......" ;
var doc = new jsPDF();
var width = doc.internal.pageSize.getWidth;
var height = doc.internal.pageSize.getHeight;
doc.addImage(img, 'JPEG', 0, 0, width, height);
doc.save('img.pdf');
I am using above code to currently convert images into pdf long images like this https://cdn.black-clover.org/file/sugois/Reality-Quest/Chapter-1/03.jpg doesn't gets its height in pdf it only shows a part of image in pdf, any way to get its full height content while keeping the width on same ratio, you can check the demo by compiling the code above. Thanks in advance. You can check the fiddle here:- https://jsfiddle.net/5v91exfs/