API referenceRendering & Viewer

rasCalcMaxima

Precompute the widest/tallest page size (MaxPageW/

C
void __stdcall rasCalcMaxima(IPGC CachePtr, int32_t FirstPage, int32_t LastPage);
Delphi
procedure rasCalcMaxima(CachePtr: IPGC; FirstPage, LastPage: Integer); stdcall;

Purpose. Precompute the widest/tallest page size (MaxPageW/ MaxPageH) across a page range — the same "widest page" concept rasInitBaseObjects (Rasterizer and Page-Cache Lifecycle) computes inline for width-fit, but here as an explicit, cacheable, range-scoped precomputation.

Description. Clamps FirstPage/LastPage into 1..PageCount (falling back to the import document's page count if the live document has none — D.ImportPageCount, an unusual fallback specific to this function among the Page Navigation, Layout, and Geometry/E04 geometry cluster), then scans that range recording the maximum width/height seen into C.MaxPageW/ C.MaxPageH.

Parameters.

ParameterDescription
CachePtrTarget page cache.
FirstPage, LastPage1-based inclusive range; out-of-range values clamp to the full document (or import-file) page count.

Return value. None. Result is read back via the cache's own MaxPageW/MaxPageH state (no direct getter exists in this ABI surface).

C# (P/Invoke)

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

Rasterizer/Rendering

Exported names

rasCalcMaxima

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.