Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
打开指定文档和笔记文件。
pdf
epub
cbz
xps
fb2
note
static openFile(filePath: string, page: number): Promise<APIResponse<boolean>>;
filePath
string
page
number
0
-1
APIResponse<boolean>
result === true
import { PluginFileAPI } from 'sn-plugin-lib'; /** * 打开文件的示例。 */ export async function exampleOpenFile() { const page = -1; const res = await PluginFileAPI.openFile('/storage/emulated/0/Document/demo.pdf', page); if (!res.success) { console.log('openFile failed', res.error); throw new Error(res.error?.message ?? 'openFile 调用失败'); } console.log('openFile result', res.result); return res.result; }