Javascript: TextField.getFormattingBounds Method
Description
Gets the formatting rectangle of a text field.
Syntax
<void> TextField.getFormattingBounds(<RequestRectangleCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the formatting rectangle. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TextField.getFormattingBounds in a practical document-editing workflow. It gets the formatting rectangle of a text field.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectFormattingBounds(textField) {
textField.getFormattingBounds(
function(rect) {
if (!rect) {
console.warn("No rectangle was returned.");
return;
}
console.log("get formatting bounds result:", rect);
},
onTxError
);
}