# Javascript: PageBorder.setMeasureFromText Method

> Sets whether the page border's distances are measured from the text.

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

---

### Description

Sets whether the page border's distances are measured from the text.

### Syntax

```javascript
<void> PageBorder.setMeasureFromText(<boolean> measureFromText, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| measureFromText | Specifies whether the page border's distances are measured from the text. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `PageBorder.setMeasureFromText` in a practical document-editing workflow. It sets whether the page border's distances are measured from the text.

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

function configureMeasureFromText(pageBorder) {
    pageBorder.setMeasureFromText(
        true,
        function() {
            console.log("set measure from text completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: PageBorder.setLeftLineWidth Method](https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/setleftlinewidth-method/llms-full.txt)
- **Next:** [Javascript: PageBorder.setOmitFirstPage Method](https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/setomitfirstpage-method/llms-full.txt)
