API referenceReporting

tblGetFirstRow

The manual row-iteration cursor family — tblGetFirstRow

C
int32_t __stdcall tblGetFirstRow(ITBL Table);
int32_t __stdcall tblGetNextRow(ITBL Table);
float __stdcall tblGetNextHeight(ITBL Table, float MaxHeight, int32_t* NextRow);
BOOL32 __stdcall tblHaveMore(ITBL Table);
Delphi
function tblGetFirstRow(const Table: ITBL): Integer; stdcall;
function tblGetNextRow(const Table: ITBL): Integer; stdcall;
function tblGetNextHeight(const Table: ITBL; MaxHeight: Single; NextRow: PInteger): Single; stdcall;
function tblHaveMore(const Table: ITBL): LongBool; stdcall;

Purpose. The manual row-iteration cursor family — tblGetFirstRow resets it, tblGetNextRow advances it, tblGetNextHeight previews how many more rows would fit in a given height budget without moving the cursor or drawing anything, and tblHaveMore reports whether the most recent tblDrawTable call left rows undrawn (a real pagination overflow signal, not derived from the cursor position itself).

Description. tblGetFirstRow sets Table.RowCursor := 0 and returns 0 if the table has any rows, -1 if it's empty. tblGetNextRow increments RowCursor and returns the new position, or -1 once it runs past the last row (the cursor itself keeps incrementing past the end, though — repeated calls after the end all return -1 without ever resetting, until tblGetFirstRow is called again). tblGetNextHeight is a genuine preview-only calculator: it walks forward from the *current* cursor position (without modifying it), accumulating RowH values until the next addition would exceed MaxHeight, and reports both the accumulated height (return value) and the row index it stopped at (NextRow, if non-nil) — useful for a caller deciding *before* calling tblDrawTable whether the remaining table content fits in the space left on the current page. tblHaveMore reads a dedicated Boolean field (TLumasTable.HaveMore) that is only ever set by tblDrawTable itself when it stops due to MaxHeight — it is not derived from comparing RowCursor to Rows.Count, so calling tblHaveMore before ever calling tblDrawTable reports the field's default (unset) state, not a computed "are there more rows" answer.

Parameters.

ParameterDescription
TableTarget table handle.
MaxHeight*(GetNextHeight only)* The height budget to preview against.
NextRow*(GetNextHeight only)* Output: the row index the preview stopped at; may be nil to skip.

Return value. tblGetFirstRow: 0 if the table has rows, -1 if empty. tblGetNextRow: the new cursor position, or -1 past the end. tblGetNextHeight: the accumulated height that would fit. tblHaveMore: True only after a tblDrawTable call that stopped early due to MaxHeight.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int tblGetFirstRow(IntPtr Table);
Area
Reporting
Category

Misc

Exported names

tblGetFirstRow

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.