PDFium Component Docs

RenderTile method

Component: TPdfView  ·  Unit: PDFium
Render a rectangular area of a page to a new bitmap. Returned bitmap has to be released manually

Syntax

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

RotationTRotation. Clockwise rotation to apply when rendering the tile: ro0, ro90, ro180, or ro270.
OptionsTRenderOptions. Set of rendering flags controlling annotation visibility, LCD text, etc.

 

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

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

Description

Renders a rectangular tile of the current page into a bitmap. Left, Top, Width, and Height define the tile area within a virtual full-page render of size PageWidth × PageHeight pixels. This lets you render large pages at high resolution in smaller, memory-efficient tiles

The function overload allocates a new TBitmap which the caller must free. The procedure overload renders into an existing bitmap. This method is useful for printing at high DPI or generating image exports at resolutions greater than the screen

Example

// Render the top-left 512x512 tile of a 2048x2048 full-page render
var Bmp: TBitmap;
begin
  Bmp := PdfView.RenderTile(0, 0, 512, 512, 2048, 2048);
  try
    Image1.Picture.Assign(Bmp);
  finally
    Bmp.Free;
  end;
end;

See Also

TPdfView.RenderPage, TPdfView.Zoom, TPdfView.PageRotation