PDFium Component Docs

RenderPageThumbnail method

Component: TPdf  ·  Unit: PDFium
Renders any one-based page into a bitmap that fits within the requested thumbnail bounds

Syntax

function RenderPageThumbnail(PageIndex, MaxWidth, MaxHeight: Integer): TBitmap;

Parameters

PageIndexInteger - One-based page index to render
MaxWidthInteger - Maximum thumbnail width in pixels
MaxHeightInteger - Maximum thumbnail height in pixels

Return Value

Một TBitmap thuộc quyền sở hữu của người gọi, hoặc nil khi tài liệu không hoạt động, chỉ số trang không hợp lệ, hoặc kích thước yêu cầu không dương

Description

The method loads the requested page temporarily, preserves the page aspect ratio, renders the thumbnail on a white background, and closes the temporary page handle before returning

It does not change PageNumber, replace the current loaded page, or fire page-change notifications

Remarks

Example

Bmp := Pdf1.RenderPageThumbnail(3, 180, 240);
try
  if Bmp <> nil then
    Image1.Picture.Assign(Bmp);
finally
  Bmp.Free;
end;

See Also

TPdf.RenderPage, TPdf.Thumbnail, TPdf.PageCount