API referenceForms

pdfSetPageFormat

Set the pending page size from a table of 28 standard DIN

C
BOOL32 __stdcall pdfSetPageFormat(PPDF IPDF, int32_t Value);
Delphi
function pdfSetPageFormat(const IPDF: PPDF; Value: Integer): LongBool; stdcall;

Purpose. Set the pending page size from a table of 28 standard DIN and US page-format presets (A0-A10, B4-B6, C3-C6/C65, DL, E4-E6/E65, M5/ M65, US Legal, US Letter), by index.

Description. Not related to the AcroForm/XFA formatting functions above despite the "Format" naming — this sets FPendingWidth/ FPendingHeight, the same pending-page-geometry state written by pdfSetPageHeight/similar width setters, so it applies to the next page created, not the current page or any existing page. Value is a 0-based index (0=A3, 1=A4, ..., 27=A10 — note the table is not in a strictly "A0 first" order; A4 is index 1, while A0/A1/A2 are tacked on at indices 20-22) into a fixed table of point dimensions; any value outside 0..27 returns False and leaves the pending size unchanged.

Parameters.

ParameterDescription
IPDFDocument handle.
Value0-based preset index (see Description for the non-sequential DIN/US ordering); out of range → False, no change.

Return value. True if Value resolved to a known preset (and the pending size was updated); False otherwise.

C# (P/Invoke)

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

Setters

Exported names

pdfSetPageFormat

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.