Skip to main content
static generateMarkThumbnails(
 markPath: string,
 page: number,
 pngPath: string,
 size: Size
): Promise<APIResponse<boolean>>;
Parameters
ParameterTypeDescription
markPathstringDOC file path
pagenumberPage index (starts from 0)
pngPathstringOutput PNG path (must end with .png)
sizeSizeOutput image size
Returns

Example

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

/**
 * Example: generate a mark thumbnail.
 */
export async function exampleGenerateMarkThumbnails() {
 const markPath = '/storage/emulated/0/Note/demo.pdf';
 const page = 1;
 const pngPath = '/storage/emulated/0/Note/out/mark.png';
 const size = { width: 512, height: 512 };

 const res = await PluginFileAPI.generateMarkThumbnails(markPath, page, pngPath, size);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'generateMarkThumbnails call failed');
 }
 return res.result;
}