API referenceRendering & Viewer

rasGetPagePos

Resolve a specific page's top-left position in the

C
BOOL32 __stdcall rasGetPagePos(IPGC CachePtr, int32_t PageNum, int32_t* X, int32_t* Y);
Delphi
function rasGetPagePos(CachePtr: IPGC; PageNum: Integer; var X, Y: Integer): LongBool; stdcall;

Purpose. Resolve a specific page's top-left position in the cache's current scrolled viewport — the by-page-number counterpart to rasGetPageMatrix's current-page-only computation.

Description. Same vertical-accumulation logic as rasGetPageMatrix/rasGetPageAt, but for an explicit PageNum (validated against 1..PageCount) rather than the cache's stored current page — this is the function to use to locate an *arbitrary* page's position; rasGetPageMatrix cannot.

Parameters.

ParameterDescription
CachePtrTarget page cache.
PageNum1-based page to locate (any page, not just the current one).
X, YOutput: top-left in scrolled viewport coordinates.

Return value. True if PageNum is valid and the document resolves; False otherwise.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Rendering & Viewer
Category

Rasterizer/Rendering

Exported names

rasGetPagePos

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.