Skip to main content
Version: Version 5

Type Alias: ThumbnailOptions

ThumbnailOptions = object

Options for configuring thumbnail generation.

Properties

format?

optional format?: "png" | "jpeg"

Image format for the thumbnail. Supported formats are ‘png’ and ‘jpeg’. By default, thumbnails will be generated in ‘png’ format.


height?

optional height?: number

Height of the thumbnail in pixels. By default, thumbnails will have a height of 100 pixels.


onThumbnail?

optional onThumbnail?: (thumbnail, pageNumber) => void

Callback fired for each thumbnail as it loads. Used for progressive rendering. Only applicable when using getThumbnails() method.

Parameters

thumbnail

HTMLImageElement

pageNumber

number

Returns

void


quality?

optional quality?: number

Quality for JPEG format. Only applies when format is ‘jpeg’. Value should be between 0 and 1, where 1 is the highest quality. By default, the quality will be set to 0.92.


signal?

optional signal?: AbortSignal

AbortSignal to cancel thumbnail generation. Only applicable when using getThumbnails() method.


width?

optional width?: number

Width of the thumbnail in pixels. By default, thumbnails will have a width of 100 pixels.