Javascript: TextFrame.getInternalMargins Method
Description
Sets the distances, in twips, between the text frame's border line and the text.
Syntax
<void> TextFrame.getInternalMargins(<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 TextFrame.getInternalMargins in a practical document-editing workflow. It sets the distances, in twips, between the text frame's border line and the text.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectInternalMargins(textFrame) {
textFrame.getInternalMargins(
function(distances) {
if (!distances) {
console.warn("No distances was returned.");
return;
}
console.log("get internal margins result:", distances);
},
onTxError
);
}