PDFiumPas 文件

RenderPage 方法

元件: TPdfView  ·  單元: PDFium
將頁面內容繪製到裝置上,裝置可以是螢幕、點陣圖或印表機

Syntax

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

DeviceContextHDC. Target device context to render into (screen DC, printer DC, memory DC, etc.).
RotationTRotation. Clockwise rotation to apply when rendering: ro0, ro90, ro180, or ro270.
OptionsTRenderOptions. Set of rendering flags controlling annotation display, LCD text, grayscale, etc.

 

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

RotationTRotation. Clockwise rotation to apply when rendering.
OptionsTRenderOptions. Set of rendering flags.

 

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

BitmapTBitmap. An existing bitmap to render the page into.
RotationTRotation. Clockwise rotation to apply when rendering.
OptionsTRenderOptions. Set of rendering flags.

Description

Renders the current page to the specified destination at the given position and size. Three overloads are available:

The background fill color is taken from PageColor. For tiled high-resolution rendering, use RenderTile.

Example

// 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;

See Also

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