# Javascript: PageBorder.getLeftDistance Method

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

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: PageBorder.getLeftDistance Method
- **375 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/getleftdistance-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/getleftdistance-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/getleftdistance-method/llms-full.txt

---

### Description

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

### Syntax

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

### Parameters

| Parameter | Description |
|---|---|
| callback | the distance, in twips, of the left 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.getLeftDistance` in a practical document-editing workflow. It gets the distance, in twips, of the left 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 inspectLeftDistance(pageBorder) {
    pageBorder.getLeftDistance(
        function(result) {
            console.log("get left distance result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: PageBorder.getFirstPageOnly Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/getfirstpageonly-method/llms-full.txt)
- **Next:** [Javascript: PageBorder.getLeftLineColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/getleftlinecolor-method/llms-full.txt)
