API referenceRendering & Viewer

rasPrefetchPage

Pre-render a page into the cache's bitmap cache ahead of

C
BOOL32 __stdcall rasPrefetchPage(IPGC CachePtr, int32_t PageNum);
Delphi
function rasPrefetchPage(CachePtr: IPGC; PageNum: Integer): LongBool; stdcall;

Purpose. Pre-render a page into the cache's bitmap cache ahead of it becoming visible, so a subsequent rasPaint scroll to it is a cache hit rather than a fresh render.

Description. Computes the page's unrotated render size (same rotation-aware width/height swap as rasPaint) and calls the same shared CacheRenderPage — genuinely real, not merely a hint; the rendered bitmap is retained exactly as if rasPaint had rendered it during a normal scroll.

Parameters.

ParameterDescription
CachePtrTarget page cache.
PageNum1-based page to prefetch.

Return value. True if the page rendered and was cached; False if CachePtr/document don't resolve or PageNum is out of range.

C# (P/Invoke)

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

Rasterizer/Rendering

Exported names

rasPrefetchPage

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.