API referenceCore SDK

pdfSetOnPageBreakProc

Register a callback invoked whenever flowed/continued text

C
BOOL32 __stdcall pdfSetOnPageBreakProc(PPDF IPDF, void* Data, TOnPageBreakProc OnBreakProc);
Delphi
function pdfSetOnPageBreakProc(const IPDF: PPDF; Data: Pointer; OnBreakProc: TOnPageBreakProc): LongBool; stdcall;

Purpose. Register a callback invoked whenever flowed/continued text writing (e.g. pdfBeginContinueText, Core Text Output) triggers an automatic page break — the callback can inspect the break position and return False to suppress the automatic break.

Description. Real and, per an inline source comment, was itself previously a documented gap: "cdecl TOnPageBreakProc callback... Was never invoked before" — confirming the callback is now genuinely fired at the actual page-break decision point (passing Data, the X position, current Y, and a fixed True continuation flag), with the callback's return value (<> 0) able to influence the break.

Parameters.

ParameterDescription
IPDFDocument handle.
DataOpaque user data passed through to every callback invocation.
OnBreakProcThe callback; nil disables it.

Return value. True if IPDF is valid.

See also. pdfBeginContinueText.

C# (P/Invoke)

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

Setters

Exported names

pdfSetOnPageBreakProc

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.