RenderPageRegionToFile

Rendering and printing

Description

Renders a rectangular region of a page to a bitmap file. The output bitmap is sized to the region, and the top-left corner of the region becomes the top-left corner of the bitmap

Syntax

Delphi

Function TPDFlib.RenderPageRegionToFile(DPI: Double; Page: Integer; Const Clip: WideString; Const FileName: WideString): Integer;

Parameters

DPIRendering resolution before the current render scale is applied
Page1-based page number
ClipRegion as "Left,Top,Width,Height" in PDF points, measured from the top-left corner of the page; numbers use a period as the decimal separator
FileNamePath of the 24-bit BMP file to create

Return values

Returns 1 when the region was rendered and saved. Returns 0 when Clip is malformed or has no area, the page cannot be selected, rendering fails or the file cannot be written

Remarks

Windows only. The built-in and Cairo renderers draw the region; with PDFium selected the region is drawn by the built-in renderer. The current render offset is not applied to the region. A render or write failure leaves an existing destination intact

See RenderPageToDCClip and GetRenderCapabilities