Javascript: FrameBase.getTextDistances Method
Description
Gets the distances, in twips, between the frame and the document's text.
Syntax
<void> FrameBase.getTextDistances(<RequestDistancesCallback> 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 FrameBase.getTextDistances in a practical document-editing workflow. It gets the distances, in twips, between the frame and the document's text.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectTextDistances(frameBase) {
frameBase.getTextDistances(
function(distances) {
if (!distances) {
console.warn("No distances was returned.");
return;
}
console.log("get text distances result:", distances);
},
onTxError
);
}