Click or drag to resize

unlock Method

Unlocks the object represented by this PdfObject instance for which isLocked Method is true.

Syntax
JavaScript
function unlock();

Parameters

None

Return Value

Type: Boolean

true if operation completed successfully; otherwise, false.

Remarks

Not all objects can be unlocked (e.g. isLocked Method is false).

All form fields with the same name will be unlocked when calling this method. Unlocking a form field may result in subtle changes to a form field's behavior (such as JavaScript) and appearance (such as font). It is recommended to only unlock form fields which need to be changed in a document.

PdfButtonFields and PdfSignatureFields can not be unlocked at this time.

Unlocking a field will also set the PdfObjectProperties Properties "moveable", "resizable", and "stylable" to true.

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 ObjectClickEventArgs as an argument)
function objectClickHandler(evt)
{
    //unlock the clicked object
    evt.obj.unlock();
}

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

//attach event handler to objectClick event
myApi.addEventListener("objectClick", objectClickHandler);
See Also

Other Resources