API reference › Rendering & Viewer
rasSetPageScale
Get/set the cache's fit-mode (psFitWidth/psFitHeight/
TPDFPageScale __stdcall rasGetPageScale(IPGC CachePtr);
void __stdcall rasSetPageScale(IPGC CachePtr, TPDFPageScale Value);
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.
| Parameter | Description |
|---|---|
CachePtr | Target page cache. |
Value | The new fit mode. |
Return value. rasGetPageScale: the stored mode (TPDFPageScale(0) if CachePtr doesn't resolve).
C# (P/Invoke)
public static extern void rasSetPageScale(IntPtr CachePtr, TPDFPageScale Value);
Rasterizer/Rendering
rasSetPageScale
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.