import { PluginDocAPI, type Size } from 'sn-plugin-lib';
/**
* Example: generate a PNG image for a specified page of the current document.
*/
export async function exampleGenerateCurrentDocImage() {
const page = 0;
const pngPath = '/storage/emulated/0/Download/current-doc-page-0.png';
const size: Size = { width: 1080, height: 1440 };
const type = 0;
console.log('generateCurrentDocImage params:', { page, pngPath, size, type });
const res = await PluginDocAPI.generateCurrentDocImage(page, pngPath, size, type);
if (!res.success) {
throw new Error(res.error?.message ?? 'generateCurrentDocImage call failed');
}
console.log('generateCurrentDocImage result:', res.result);
return res.result;
}