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 generateNotePng(params: {
notePath: string;
page: number;
times: number;
pngPath: string;
type: number;
}): Promise<APIResponse<boolean>>;
参数
| 参数 | 类型 | 说明 |
|---|
params.notePath | string | 笔记文件路径 |
params.page | number | 页码(从 0 开始) |
params.times | number | 图片放大倍数(通常为 1 或 2) |
params.pngPath | string | PNG 输出路径(需以 .png 结尾) |
params.type | number | 生成类型:0 透明底图片,1 白底图片 |
返回
import { PluginFileAPI } from 'sn-plugin-lib';
/**
* 生成页面 PNG 的示例。
*/
export async function exampleGenerateNotePng() {
const res = await PluginFileAPI.generateNotePng({
notePath: '/storage/emulated/0/Note/demo.note',
page: 1,
times: 1,
pngPath: '/storage/emulated/0/Note/out/page.png',
type: 1,
});
if (!res.success) {
throw new Error(res.error?.message ?? 'generateNotePng 调用失败');
}
return res.result;
}