Skip to main content
static insertNotePage(params: { notePath: string; page: number; template: string }): Promise<APIResponse<boolean>>;
Parameters
ParameterTypeDescription
params.notePathstringNote file path
params.pagenumberPage number (starts from 0)
params.templatestringTemplate name for the new page
Returns

Example

import { PluginFileAPI } from 'sn-plugin-lib';

/**
 * Insert new page example.
 */
export async function exampleInsertNotePage() {
 const res = await PluginFileAPI.insertNotePage({
 notePath: '/storage/emulated/0/Note/demo.note',
 page: 2,
 template: 'style_blank',
 });

 if (!res.success) {
 throw new Error(res.error?.message ?? 'insertNotePage call failed');
 }
 return res.result;
}