> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getCurrentDocText

> Get text content of a page in the currently opened DOC.

```ts theme={null}
static getCurrentDocText(page: number): Promise<APIResponse<string>>;
```

**Parameters**

| Parameter | Type     | Description                  |
| --------- | -------- | ---------------------------- |
| `page`    | `number` | Page index (starts from `0`) |

**Returns**

* [`APIResponse<string>`](/en/api-reference/supernote-plugin/types/api-response):
  `result` is the text content of the specified page

## Example

```ts wrap theme={null}
import { PluginDocAPI } from 'sn-plugin-lib';

/**
 * Example: get page text from the current document.
 */
export async function exampleGetCurrentDocText() {
 const page = 1;
 const res = await PluginDocAPI.getCurrentDocText(page);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'getCurrentDocText call failed');
 }
 return res.result;
}
```
