API referenceRendering & Viewer

rasSetClientRect

Resize the page cache's viewport from a client rectangle.

C
void __stdcall rasSetClientRect(IPGC CachePtr, HDC DC, TIntRect* ClientRect);
Delphi
procedure rasSetClientRect(CachePtr: IPGC; DC: HDC; var ClientRect: TIntRect); stdcall;

Purpose. Resize the page cache's viewport from a client rectangle.

Description. Computes width/height from ClientRect's corners, normalizing a reversed rect (negative width/height) via Abs, and only updates C.Width/C.Height if the resulting size is non-degenerate (both > 0) — a zero-area or unset rect is silently ignored rather than zeroing the viewport. DC is accepted but never read — this function does not touch any device context despite the parameter.

Parameters.

ParameterDescription
CachePtrTarget page cache.
DCAccepted but never read.
ClientRectCorners in either order (auto-normalized); ignored entirely if the resulting size is 0 in either dimension.

Return value. None.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern void rasSetClientRect(IntPtr CachePtr, UIntPtr DC, ref TIntRect ClientRect);
Area
Rendering & Viewer
Category

Rasterizer/Rendering

Exported names

rasSetClientRect

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.