> ## 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

> 获取当前打开文档指定页面的文本内容。

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

**参数**

| 参数     | 类型       | 说明         |
| ------ | -------- | ---------- |
| `page` | `number` | 页码（从 0 开始） |

**返回**

* [`APIResponse<string>`](/zh/api-reference/supernote-plugin/types/api-response)：
  `result` 为文档指定页面的文本内容

## 示例

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

/**
 * 获取当前文档某页文本的示例。
 */
export async function exampleGetCurrentDocText() {
  const page = 1;
  const res = await PluginDocAPI.getCurrentDocText(page);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getCurrentDocText 调用失败');
  }
  return res.result;
}
```
