PDFium Delphi Component Docs

RenderPage 方法

组件: TPdfView  ·  单元: PDFium
将页面内容渲染到设备上,设备可以是屏幕、位图或打印机

语法

procedure RenderPage(DeviceContext: HDC; Left, Top, Width, Height: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []);

DeviceContextHDC. 要渲染到的目标设备上下文(屏幕 DC、打印机 DC、内存 DC 等)
RotationTRotation. 渲染时应用的顺时针旋转:ro0、ro90、ro180 或 ro270
OptionsTRenderOptions. 控制注释显示、LCD 文本、灰度等的渲染标志集

 

function RenderPage(Left, Top, Width, Height: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []): TBitmap;

RotationTRotation. 渲染时应用的顺时针旋转
OptionsTRenderOptions. 渲染标志集

 

procedure RenderPage(Bitmap: TBitmap; Left, Top, Width, Height: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []);

BitmapTBitmap. 要渲染页面进去的现有位图
RotationTRotation. 渲染时应用的顺时针旋转
OptionsTRenderOptions. 渲染标志集

说明

将当前页面渲染到指定目标、指定位置和大小。提供三个重载:

背景填充色取自 PageColor。对于分块高分辨率渲染,使用 RenderTile

示例

// 将当前页面渲染为 600x800 位图
var Bmp: TBitmap;
begin
  Bmp := PdfView.RenderPage(0, 0, 600, 800);
  try
    Bmp.SaveToFile('page.bmp');
  finally
    Bmp.Free;
  end;
end;

参见

TPdfView.RenderTile, TPdfView.Zoom, TPdfView.PageRotation, TPdfView.PageColor