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

# getNoteTotalPageNum

> Get the total page count of a note file.

```ts wrap theme={null}
static getNoteTotalPageNum(NOTEPath: string): Promise<APIResponse<number>>;
```

**Parameters**

| Parameter  | Type     | Description    |
| ---------- | -------- | -------------- |
| `NOTEPath` | `string` | NOTE file path |

**Returns**

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

## Example

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

/**
 * Example: get the total page count.
 */
export async function exampleGetNoteTotalPageNum() {
 const NOTEPath = '/storage/emulated/0/Note/demo.note';
 const res = await PluginFileAPI.getNoteTotalPageNum(NOTEPath);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'getNoteTotalPageNum call failed');
 }
 return res.result;
}
```
