API reference › Rendering & Viewer
rasSetCurrPage
Get/set the page cache's current page (the authoritative
int32_t __stdcall rasGetCurrPage(IPGC CachePtr);
void __stdcall rasSetCurrPage(IPGC CachePtr, int32_t PageNum);
function rasGetCurrPage(CachePtr: IPGC): Integer; stdcall;
procedure rasSetCurrPage(CachePtr: IPGC; PageNum: Integer); stdcall;
Purpose. Get/set the page cache's current page (the authoritative page selector in single-page mode; the reference/anchor page in continuous layout).
Description. rasSetCurrPage clamps PageNum into 1..PageCount (falling back to page 1 if the document reports fewer than 1 page), and — real, deliberate side effect — resets the scroll origin (ScrollX/ScrollY both to 0), so changing the current page always snaps the view back to the top-left of that page rather than preserving any existing scroll offset. rasGetCurrPage is a plain accessor.
Parameters.
| Parameter | Description |
|---|---|
CachePtr | Target page cache. |
PageNum | *(Set only)* 1-based; clamped into range. |
Return value. rasGetCurrPage: current page (0 if CachePtr doesn't resolve — note 0 is not a valid page number, so this doubles as an implicit failure signal).
C# (P/Invoke)
public static extern void rasSetCurrPage(IntPtr CachePtr, int PageNum);
Rasterizer/Rendering
rasSetCurrPage
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.