# Javascript: ParagraphCollection.getItemAtLocation Method

> Gets the Paragraph at a certain geometrical position.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: ParagraphCollection.getItemAtLocation Method
- **491 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphcollection/getitematlocation-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphcollection/getitematlocation-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphcollection/getitematlocation-method/llms-full.txt

---

### Description

Gets the Paragraph at a certain geometrical position.

### Syntax

```javascript
<void> ParagraphCollection.getItemAtLocation(<number> x, <number> y, <RequestParagraphCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| x | Specifies the Paragraph's horizontal location in pixels with an origin at the top left corner. |
| y | Specifies the Paragraph's vertical location in pixels with an origin at the top left corner. |
| callback | Receives the Paragraph at a certain geometrical position. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `ParagraphCollection.getItemAtLocation` in a practical document-editing workflow. It gets the Paragraph at a certain geometrical position.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const paragraphs = mainText.paragraphs;
    paragraphs.getItemAtLocation(
        1,
        1,
        function(result) {
            if (!result) {
                console.warn("No paragraph was returned.");
                return;
            }
            
            console.log("get item at location result:", result);
        },
        onTxError
    );
}, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: ParagraphCollection.getItem Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphcollection/getitem-method/llms-full.txt)
- **Next:** [ParagraphFormat Object](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/llms-full.txt)
