API referenceRendering & Viewer

rasGetPageScale

Get/set the cache's fit-mode (psFitWidth/psFitHeight/

C
TPDFPageScale __stdcall rasGetPageScale(IPGC CachePtr);
void __stdcall rasSetPageScale(IPGC CachePtr, TPDFPageScale Value);
Delphi
function rasGetPageScale(CachePtr: IPGC): TPDFPageScale; stdcall;
procedure rasSetPageScale(CachePtr: IPGC; Value: TPDFPageScale); stdcall;

Purpose. Get/set the cache's fit-mode (psFitWidth/psFitHeight/ psFitBest/psFitZoom) — the mode rasInitBaseObjects (Rasterizer and Page-Cache Lifecycle) consults to compute the actual numeric zoom.

Description. rasSetPageScale stores the mode and, unless the new mode is psFitZoom, resets C.Zoom := 0 — flagging "needs re-fit" so the next rasInitBaseObjects/layout pass recomputes a real zoom for the new fit mode — and clears the render cache immediately (the zoom is about to change). Switching *to* psFitZoom leaves whatever numeric zoom was already active untouched (there is no explicit value parameter here to set alongside the mode switch — a caller wanting a specific zoom in psFitZoom mode must also call rasZoom).

Parameters.

ParameterDescription
CachePtrTarget page cache.
ValueThe new fit mode.

Return value. rasGetPageScale: the stored mode (TPDFPageScale(0) if CachePtr doesn't resolve).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern TPDFPageScale rasGetPageScale(IntPtr CachePtr);
Area
Rendering & Viewer
Category

Rasterizer/Rendering

Exported names

rasGetPageScale

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.