PDFium Delphi Component Docs

RenderPageWithMatrix method

Component: TPdf  ·  Unit: PDFium
Render the current page through an arbitrary transform matrix with a clip rectangle

Syntax

function RenderPageWithMatrix(Width, Height: Integer; const Matrix: FS_MATRIX; const Clip: TPdfRectangle; Options: TRenderOptions = []; Color: TColor = clWhite): TBitmap;

Width, HeightInteger. Size of the destination bitmap in pixels
MatrixFS_MATRIX. Transform applied to the page before rasterising, in PDF matrix order (a, b, c, d, e, f)
ClipTPdfRectangle. Clip rectangle in destination pixels; content outside it is not painted
OptionsTRenderOptions. Set of TRenderOption flags controlling rendering quality and behaviour
ColorTColor. Background fill applied before rendering Defaults to clWhite
ResultTBitmap. A newly created bitmap the caller owns and must free

 

procedure RenderPageWithMatrix(Bitmap: TBitmap; Width, Height: Integer; const Matrix: FS_MATRIX; const Clip: TPdfRectangle; Options: TRenderOptions = []; Color: TColor = clWhite);

BitmapTBitmap. An existing bitmap to render into. The caller creates and frees it
Width, HeightInteger. Size of the destination area in pixels
MatrixFS_MATRIX. Transform applied to the page
ClipTPdfRectangle. Clip rectangle in destination pixels
OptionsTRenderOptions. Rendering flags
ColorTColor. Background fill applied before rendering

Description

Where RenderPage offers a rectangle and one of four quarter-turn rotations, this exposes the full transform PDFium renders with: any scale, any rotation angle, shear, mirroring or a combination

The clip rectangle is applied in destination space, which makes it the natural way to repaint one damaged region of a zoomed view without re-rendering the whole page

The matrix maps PDF page units into destination pixels. An unrotated fit-to-width render is (Width / PageWidth, 0, 0, Height / PageHeight, 0, 0); mirroring negates a or d and shifts the corresponding translation

See Also

RenderPage, RenderTile, RenderPageBanded, TransformPageContent