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

# generateNoteTemplatePng

> Generate a background-template PNG for a note page.

```ts wrap theme={null}
static generateNoteTemplatePng(NOTEPath: string, page: number, pngPath: string): Promise<APIResponse<boolean>>;
```

**Parameters**

| Parameter  | Type     | Description                            |
| ---------- | -------- | -------------------------------------- |
| `NOTEPath` | `string` | NOTE file path                         |
| `page`     | `number` | Page index (starts from `0`)           |
| `pngPath`  | `string` | Output PNG path (must end with `.png`) |

**Returns**

* [`APIResponse<boolean>`](/en/api-reference/supernote-plugin/types/api-response):
  `result === true` indicates generation succeeded

## Example

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

/**
 * Example: generate a background-template PNG.
 */
export async function exampleGenerateNoteTemplatePng() {
 const NOTEPath = '/storage/emulated/0/Note/demo.note';
 const page = 1;
 const pngPath = '/storage/emulated/0/Note/out/template.png';

 const res = await PluginFileAPI.generateNoteTemplatePng(NOTEPath, page, pngPath);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'generateNoteTemplatePng call failed');
 }
 return res.result;
}
```
