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

範例

// Render current page to a 600x800 bitmap
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