# Javascript: PageBorder.getRightDistance Method

> Gets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: PageBorder.getRightDistance Method
- **378 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getrightdistance-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getrightdistance-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getrightdistance-method/llms-full.txt

---

### Description

Gets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText.

### Syntax

```javascript
<void> PageBorder.getRightDistance(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `PageBorder.getRightDistance` in a practical document-editing workflow. It gets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText.

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

function inspectRightDistance(pageBorder) {
    pageBorder.getRightDistance(
        function(result) {
            console.log("get right distance result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: PageBorder.getOmitFirstPage Method](https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getomitfirstpage-method/llms-full.txt)
- **Next:** [Javascript: PageBorder.getRightLineColor Method](https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getrightlinecolor-method/llms-full.txt)
