hasImage Method |
Gets a value indicating whether this ImageShape has an image.
function hasImage();
None
Type: Boolean
true if this PdfObject is of ImageShape type and it has an image set; otherwise, false.If this PdfObject is not an ImageShape, this method will always return false.
Add a new image object to the first page:
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance //Add object var newImage = myApi.getPage(1).addObject(myApi.ObjectType.ImageShape); //Set image for object using key (see Easy-Integration.aspx sample for ) newImage.setImage("signature"); //As setImage() does not immediately set the image, we can check that the image was set in 1 second window.setTimeout(function(){ if(!newImage.hasImage()) {window.alert("Image was not set!");} }, 1000);