跳转到主要内容
static getPageSize(notePath: string, page: number): Promise<APIResponse<Size>>;
参数
参数类型说明
notePathstring笔记/文档文件路径
pagenumber页码(从 0 开始)
返回

示例

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

/**
 * 获取页面像素尺寸的示例。
 */
export async function exampleGetPageSize() {
  const notePath = '/storage/emulated/0/Note/demo.note';
  const page = 1;

  const res = await PluginFileAPI.getPageSize(notePath, page);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getPageSize 调用失败');
  }
  return res.result;
}