API referenceRendering & Viewer

rasSetPageLayout

Get/set the cache's active page layout (single-page vs.

C
TPageLayout __stdcall rasGetPageLayout(IPGC CachePtr);
void __stdcall rasSetPageLayout(IPGC CachePtr, TPageLayout Value);
TPageLayout __stdcall rasGetDefPageLayout(IPGC CachePtr);
void __stdcall rasSetDefPageLayout(IPGC CachePtr, TPageLayout Value);
Delphi
function rasGetPageLayout(CachePtr: IPGC): TPageLayout; stdcall;
procedure rasSetPageLayout(CachePtr: IPGC; Value: TPageLayout); stdcall;
function rasGetDefPageLayout(CachePtr: IPGC): TPageLayout; stdcall;
procedure rasSetDefPageLayout(CachePtr: IPGC; Value: TPageLayout); stdcall;

Purpose. Get/set the cache's active page layout (single-page vs. continuous scroll), and independently its "default" layout value.

Description. PageLayout and DefPageLayout are two entirely separate stored fields with no linkage between themrasSetDefPageLayout writes only DefPageLayout, which no other function in this cluster reads back except rasGetDefPageLayout itself (this chapter did not find it consulted by the rendering/layout pipeline; it behaves as caller-managed metadata, not an actual "reset to default" mechanism — there is no rasResetPageLayout-style function that copies DefPageLayout into PageLayout). rasSetPageLayout, by contrast, has a real behavioral effect: Value = 0 (plSinglePage) sets C.SinglePageMode := True via a dedicated boolean flag (per an inline comment, kept separate specifically so layout 0's ambiguous default doesn't silently misclassify); any other Value selects the continuous-vertical default.

Parameters.

ParameterDescription
CachePtrTarget page cache.
ValueLayout mode (0 = single page; anything else = continuous).

Return value. rasGetPageLayout/rasGetDefPageLayout: the respective stored value (TPageLayout(0) if CachePtr doesn't resolve).

C# (P/Invoke)

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

Rasterizer/Rendering

Exported names

rasSetPageLayout

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.