Click or drag to resize

textSelected Property

Gets a value representing the text which was selected when this PDF object was added to the currently loaded document (if any).

Syntax
JavaScript
this.textSelected;

Property Value

Type: String

The text which was selected when this PDF object was added.

Remarks

This property is read-only and should not be set to.

Examples
The following example uses the ObjectAddedEventArgs Class to handle the "objectAdded" event of the PdfWebControlApi Class.
JavaScript
//get API class
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance

//declare event handler function (which accepts an object of type ObjectAddedEventArgs as an argument)
function objectAddedHandler(evt)
{
    //if a strikeout annotation
    if (evt.obj.getType() == myApi.ObjectType.StrikeoutAnnotation)
    {
        evt.obj.setProperties({"contents" : "Delete the text: " + evt.textSelected, "open" : true});
    }
}

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