Javascript: TextFrame.getSize Method
Description
Gets the frame's size in twips.
Syntax
<void> TextFrame.getSize(<RequestSizeCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the current property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TextFrame.getSize in a practical document-editing workflow. It gets the frame's size in twips.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectSize(textFrame) {
textFrame.getSize(
function(size) {
if (!size) {
console.warn("No size was returned.");
return;
}
console.log("get size result:", size);
},
onTxError
);
}