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 region's top-left corner becomes the bitmap's top-left corner

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 given as "Left,Top,Width,Height" in PDF points, measured from the top-left corner of the page; numbers use a full stop 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; when PDFium is selected the region is drawn by the built-in renderer. The current render offset is not applied to the region

See RenderPageToDCClip and GetRenderCapabilities