API referenceRendering & Viewer

rasUpdate

Request a repaint — optionally switching the current page

C
void __stdcall rasUpdate(IPGC CachePtr, int32_t PageNum);
Delphi
procedure rasUpdate(CachePtr: IPGC; PageNum: Integer); stdcall;

Purpose. Request a repaint — optionally switching the current page first — through whichever of two independent host-notification mechanisms are configured: a registered paint callback, and/or a bound window handle.

Description. If PageNum > 0, sets C.CurrPage first (no range clamping here, unlike rasSetCurrPage, Page Navigation, Layout, and Geometry). Then, independently: (1) if a paint callback is registered (rasSetOnPaintCallback, below), invokes it with the full viewport rect — per an inline comment, this was previously silently discarded and now genuinely fires; (2) if C.WndHandle is set (rasSetWindowHandle, Rasterizer and Page-Cache Lifecycle), performs a complete independent re-render of the current page — fetching its content bytes fresh, building render resources, calling RenderPageToRGB at the window's own client size, and painting the result directly to the window via ViewerPaintToWindownot going through rasPaint's page-cache/tile machinery at all, a separate, simpler direct-to-window render path. Both mechanisms can fire from the same call if both are configured.

Parameters.

ParameterDescription
CachePtrTarget page cache.
PageNum> 0 switches the current page (unclamped) before repainting; ≤ 0 repaints the existing current page.

Return value. None.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern void rasUpdate(IntPtr CachePtr, int PageNum);
Area
Rendering & Viewer
Category

Rasterizer/Rendering

Exported names

rasUpdate

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.