I am using JsPDF and I want to add an image to a pdf document. I have followed the examples from the code and it seems fairly simple to make it work. For some reason I am getting a console error when I try to perform this. The error reads
"addImage is not a function". I have pulled the latest version of the code from github so I don't think this is a problem with some outdated code. Here is the code that I am using for this.
var img = new Image();
img.onload = function() {
pdfdoc.addImage(this, 10, 10);
pdfdoc.save("test.pdf");
};
Related Discussions