PDFium Delphi Component Docs

Thumbnail property

Component: TPdf  ·  Unit: PDFium
Decodes an embedded page thumbnail into a TBitmap for the current page or any requested page

Syntax

property Thumbnail: TBitmap; // read only
function ExtractThumbnail(PageNumber: Integer): TBitmap;
function ThumbnailRawData: TBytes;
function ThumbnailDecodedData: TBytes;

Description

Thumbnail decodes the current page’s optional /Thumb image into an owned TBitmap

ExtractThumbnail performs the same operation for any valid one-based page number without changing PageNumber and reuses the page's parsed scene within the configured LRU capacity

Both APIs return nil when the page carries no embedded thumbnail; a returned bitmap belongs to the caller, who must free it

ThumbnailRawData returns the current page’s embedded /Thumb bytes exactly as stored, without applying the image filters

ThumbnailDecodedData returns the same stream after its filters have been applied

Both byte accessors return an empty array when the page has no embedded thumbnail and raise EPdfError when no page is active

Remarks

Example

var Preview: TBitmap;
begin
  Preview := Pdf1.ExtractThumbnail(3);
  try
    if Preview <> nil then
      Image1.Picture.Assign(Preview);
  finally
    Preview.Free;
  end;
end;

See Also

Page, Bitmap, Image