Click or drag to resize

deleteObject Method

Deletes the object represented by this PdfObject instance.

Syntax
JavaScript
function deleteObject();

Parameters

None

Return Value

Type: Boolean

true if operation completed successfully; otherwise, false.

Remarks

Not all objects can be deleted (e.g. Deletable is false).

Examples
The following example uses the ObjectEventArgs Class to handle the "objectAdded" event of the PdfWebControlApi Class.
JavaScript
//declare event handler function (which accepts an object of type ObjectAddedEventArgs as an argument)
function objectAddedHandler(evt)
{
    //delete the new object
    evt.obj.deleteObject();
}

//get API class
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance

//attach event handler to objectAdded event
myApi.addEventListener("objectAdded", objectAddedHandler);
See Also

Other Resources