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

# getCurrentPageNum

> Get the current page index of the currently opened file.

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

## Example

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

/**
 * Example: get the current page index.
 */
export async function exampleGetCurrentPageNum() {
 const res = await PluginCommAPI.getCurrentPageNum();
 if (!res.success) {
 throw new Error(res.error?.message ?? 'getCurrentPageNum call failed');
 }
 return res.result;
}
```
