API referenceCore SDK

pdfSetPageHeader

Set a document-wide running header/footer with independent

C
BOOL32 __stdcall pdfSetPageHeaderA(PPDF IPDF, const char* L, const char* C, const char* R, double FontSize, uint32_t Color, int32_t StartPage);
BOOL32 __stdcall pdfSetPageFooterA(PPDF IPDF, const char* L, const char* C, const char* R, double FontSize, uint32_t Color, int32_t StartPage);
Delphi
function pdfSetPageHeaderA(const IPDF: PPDF; const L, C, R: PAnsiChar; FontSize: Double; Color: Cardinal; StartPage: Integer): LongBool; stdcall;
function pdfSetPageFooterA(const IPDF: PPDF; const L, C, R: PAnsiChar; FontSize: Double; Color: Cardinal; StartPage: Integer): LongBool; stdcall;

Purpose. Set a document-wide running header/footer with independent left/center/right text zones, applied starting at StartPage — a higher-level convenience over manually writing per-page text.

Description. Real (SetPageHeaderH/SetPageFooterH); A narrows each of L/C/R to raw bytes-as-string (via AnsiPtrToStr, not a true codepage-aware conversion), while W passes them through as native wide strings — matching the general A-narrowing-caveat pattern found throughout this SDK's text entry points.

Parameters.

ParameterDescription
IPDFDocument handle.
L, C, RLeft/center/right zone text.
FontSize, ColorText styling.
StartPage1-based page to begin applying the header/footer from.

Return value. True if IPDF is valid.

See also. pdfSetWatermarkText (Text State & Decoration, a related whole-document text-decoration mechanism, applied to every page unconditionally rather than from a StartPage).

C# (P/Invoke)

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

Setters

Exported names

pdfSetPageHeaderW pdfSetPageHeader pdfSetPageHeaderA

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.