# PDFViewer.search()

```ts
search(query: string): Promise<void>
```

Open the search panel and run a query across all pages. **Results are shown in the panel, not returned**: it is a UI action. For matches as data, use [doc.text.search()](https://kernstra.com/docs/web-sdk/api/doc-text/search). Needs the `extract` feature: its highlights and count say where the words are (the search panel the user types in needs no feature).

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `query` | `string` | The words to look for. |

Returns `Promise<void>`: Resolves once the search has run.

Throws:

- `FEATURE_NOT_LICENSED` without `extract`.
- `INVALID_STATE` after `destroy()`.

```ts
await viewer.search('refund');
```

Part of [PDFViewer](https://kernstra.com/docs/web-sdk/api/pdfviewer) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/pdfviewer/search
