Documentation Index
Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
Use this file to discover all available pages before exploring further.
static generateStickerThumbnail(
stickerPath: string,
thumbnailPath: string,
size: Size
): Promise<APIResponse<boolean>>;
Parameters
| Parameter | Type | Description |
|---|
stickerPath | string | Sticker source file path |
thumbnailPath | string | Thumbnail output path (usually .png) |
size | Size | Thumbnail size (keep the original aspect ratio). You can get it via getStickerSize. |
Returns
Example
import { PluginCommAPI } from 'sn-plugin-lib';
/**
* Example: generate a sticker thumbnail.
*/
export async function exampleGenerateStickerThumbnail() {
const stickerPath = '/storage/emulated/0/Note/stickers/demo.sticker';
const thumbnailPath = '/storage/emulated/0/Note/stickers/demo_thumb.png';
const sizeRes = await PluginCommAPI.getStickerSize(stickerPath);
if (!sizeRes.success || !sizeRes.result) {
throw new Error(sizeRes.error?.message ?? 'getStickerSize call failed');
}
const size = sizeRes.result;
const res = await PluginCommAPI.generateStickerThumbnail(stickerPath, thumbnailPath, size);
if (!res.success) {
throw new Error(res.error?.message ?? 'generateStickerThumbnail call failed');
}
return res.result;
}