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.
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
Example
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;
}