PDFium Delphi Component Docs

ExtractThumbnail method

Component: TPdf  ·  Unit: PDFium
Read the thumbnail image a page stores in the file, without rendering the page

Syntax

function ExtractThumbnail(PageNumber: Integer): TBitmap;

PageNumberInteger. One-based page number. A number outside the document returns nil
ResultTBitmap. The embedded thumbnail as a bitmap the caller owns and must free, or nil when the page stores none

Description

PDF pages may carry a /Thumb image so a viewer can show a page preview without rasterising the page. This decodes that image and hands it back as a bitmap

It works on any page, not only the current one, and does not change PageNumber: the page is taken from the internal page cache if it is not already loaded

A nil result means the page has no embedded thumbnail. To obtain a picture in that case, render one with RenderPageThumbnail

See Also

Thumbnail, RenderPageThumbnail, ThumbnailRawData, ThumbnailDecodedData