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>>;
参数
| 参数 | 类型 | 说明 |
|---|
notePath | string | 笔记文件路径 |
page | number | 页码(从 0 开始) |
pngPath | string | PNG 输出路径(需以 .png 结尾) |
返回
import { PluginFileAPI } from 'sn-plugin-lib';
/**
* 生成页面背景模版 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 调用失败');
}
return res.result;
}