I am able to add a jpg image to a pdf document using insert image but for some reason the code throws an error when I try to add a png image. Why would this be failing? This is the error that I see getting thrown
The code I am using is fairly basic from the examples I have found online.
img.onload = function() {
var width = pdfdoc.internal.pageSize.width;
var ratio = width / this.naturalWidth;
var height = this.naturalHeight * ratio;
var padding = 15;//jQuery("#docpadding").val();
var yPadding = 25;
pdfdoc.addImage(this, "PNG", padding, yPadding, width - (padding*2), height);
}