# Javascript: DocumentViewerController.find Method

> Searches the current document, ignoring case unless requested otherwise.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Path:** DS Server > Reference > JavaScript API - Document Viewer > Javascript: DocumentViewerController.find Method
- **231 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/find-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/find-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/find-method/llms-full.txt

---

### Description

Searches the current document, ignoring case unless requested otherwise.

### Syntax

```javascript
<void> DocumentViewerController.find(<string> text, [<Object> options])
```

### Parameters

| Parameter | Description |
|---|---|
| text | Text to find; an empty string clears the search. |
| options | Optional. Set `matchCase` to `true` to match letter case; defaults to `false`. |

### Return Value

This method does not return a value.

### Examples

The following example demonstrates `TXDocumentViewer.find` in a practical Document Viewer workflow. Finds a string in the currently loaded document.

```javascript
TXDocumentViewer.find("payment terms");
console.log("Searching the current document for payment terms.");
```

---

## Nearby

- **Previous:** [Javascript: DocumentViewerController.downloadDocument Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/downloaddocument-method/llms-full.txt)
- **Next:** [Javascript: DocumentViewerController.forms Property](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/forms-property/llms-full.txt)
