> ## 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.

# generateStickerThumbnail

> Generate a sticker thumbnail.

```ts theme={null}
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`](/en/api-reference/supernote-plugin/types/size) | Thumbnail size (keep the original aspect ratio). You can get it via [`getStickerSize`](/en/api-reference/supernote-plugin/plugin-comm-api/get-sticker-size). |

**Returns**

* [`APIResponse<boolean>`](/en/api-reference/supernote-plugin/types/api-response):
  `result === true` indicates generation succeeded

## Example

```ts wrap theme={null}
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;
}
```
