# Javascript: ParagraphFormat.getDirection Method

> Gets the writing direction.

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

---

### Description

Gets the writing direction.

### Syntax

```javascript
<void> ParagraphFormat.getDirection(<RequestDirectionCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the writing direction. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `ParagraphFormat.getDirection` in a practical document-editing workflow. It gets the writing direction.

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

TXTextControl.paragraphFormat.getDirection(
    function(direction) {
        if (!direction) {
            console.warn("No direction was returned.");
            return;
        }
        
        console.log("get direction result:", direction);
    },
    onTxError
);
```

---

## Nearby

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