# Javascript: TextFrame.getInternalMargins Method

> Sets the distances, in twips, between the text frame's border line and the text.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: TextFrame.getInternalMargins Method
- **397 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textframe/getinternalmargins-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textframe/getinternalmargins-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textframe/getinternalmargins-method/llms-full.txt

---

### Description

Sets the distances, in twips, between the text frame's border line and the text.

### Syntax

```javascript
<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.

```javascript
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
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TextFrame.getInsertionMode Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textframe/getinsertionmode-method/llms-full.txt)
- **Next:** [Javascript: TextFrame.getLocation Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textframe/getlocation-method/llms-full.txt)
