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

# getCurrentTotalPages

> Get total page count of the currently opened DOC.

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

**Returns**

* [`APIResponse<number>`](/en/api-reference/supernote-plugin/types/api-response):
  `result` is the total page count

## Example

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

/**
 * Example: get total page count of the current document.
 */
export async function exampleGetCurrentTotalPages() {
 const res = await PluginDocAPI.getCurrentTotalPages();
 if (!res.success) {
 throw new Error(res.error?.message ?? 'getCurrentTotalPages call failed');
 }
 return res.result;
}
```
