# Javascript: ParagraphFormat.getFrameDistance Method

> Gets the distance, in twips, between the text and the paragraph's frame.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: ParagraphFormat.getFrameDistance Method
- **318 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getframedistance-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getframedistance-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getframedistance-method/llms-full.txt

---

### Description

Gets the distance, in twips, between the text and the paragraph's frame.

### Syntax

```javascript
<void> ParagraphFormat.getFrameDistance(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the distance, in twips, between the text and the paragraph's frame. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `ParagraphFormat.getFrameDistance` in a practical document-editing workflow. It gets the distance, in twips, between the text and the paragraph's frame.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.paragraphFormat.getFrameDistance(
    function(result) {
        console.log("get frame distance result:", result);
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: ParagraphFormat.getFrame Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getframe-method/llms-full.txt)
- **Next:** [Javascript: ParagraphFormat.getFrameLineColor Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getframelinecolor-method/llms-full.txt)
