PDFium Delphi Component 文件

RenderPageByIndex 方法

组件: TPdf  ·  单元: PDFium
以精确输出尺寸渲染任意一基页面,而不改变活动的编辑页面

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

当请求的页面不是当前编辑页面时,该方法复用有界的已解析 PDFium 页面场景

以不同像素尺寸重复渲染同一页面可避免重新打开和重新解析页面,同时保留 PageNumber 和页面更改事件

返回位图的重载将返回的 TBitmap 所有权转移给调用方

Example

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

See Also

PageSceneCacheCapacity, ClearPageSceneCache, RenderPageThumbnail