Click or drag to resize

getType Method

Gets a value representing the type of object of this PdfObject instance.

Syntax
JavaScript
function getType();

Parameters

None

Return Value

Type: ObjectType Enumeration

Returns the object type.

Remarks

This method will return the object type of this PDF object.

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)
{
    //if this is an image
    if(evt.obj.getType() == evt.obj.ObjectType.ImageShape)
    {
        //display alert
        window.alert("Image was added!");
    }
}

//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