PDFium Delphi Component Docs

RenderPageByIndex method

Component: TPdf  ·  Unit: PDFium
Renders any one-based page at an exact output size without changing the active editing page

Syntax

function RenderPageByIndex(PageNumber, Width, Height: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []; Color: TColor = clWhite): TBitmap;

procedure RenderPageByIndex(Bitmap: TBitmap; PageNumber, Width, Height: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []; Color: TColor = clWhite);

Description

The method reuses a bounded parsed PDFium page scene when the requested page is not the current editing page

Repeated renders of the same page at different pixel sizes avoid reopening and reparsing the page while preserving PageNumber and page-change events

The bitmap-returning overload transfers ownership of the returned TBitmap to the caller

Example

Bmp := Pdf1.RenderPageByIndex(12, 1600, 2200);
try
  Image1.Picture.Assign(Bmp);
finally
  Bmp.Free;
end;

See Also

PageSceneCacheCapacity, ClearPageSceneCache, RenderPageThumbnail