ITBL __stdcall tblCreateTable(PPDF IPDF, uint32_t AllocRows, uint32_t NumCols, float Width, float DefRowHeight);
void __stdcall tblDeleteTable(ITBL* Table);
function tblCreateTable(const IPDF: PPDF; AllocRows, NumCols: Cardinal; Width, DefRowHeight: Single): ITBL; stdcall;
procedure tblDeleteTable(var Table: ITBL); stdcall;
Purpose. Create/destroy a standalone table object.
Description. Ignored parameter: AllocRows is accepted by the ABI but never used — TLumasTable.Create(ANumCols, AWidth, ADefRowH)'s real constructor signature has no row-preallocation parameter at all (confirmed by reading the class declaration directly), so there is no way for this hint to have any effect even in principle; rows are always added one at a time via tblAddRow/tblAddRows against a plain TList, growing dynamically regardless of AllocRows. IPDF may be nil — per an inline comment, "table can be created standalone; Doc is only needed for DrawTable" — a table can be fully built (rows, columns, cell content, styling) with no document attached at all. However, verified: IPDF supplied here is the ONLY way to make the table drawable — it populates the real Doc field tblDrawTable (Table Pagination Cursor, Introspection, and Drawing) actually checks; tblSetPDFInstance (below) writes a completely different, disconnected field and can NOT retroactively make a nil-created table drawable (see its own entry below for the confirmed details) — despite tblSetPDFInstance's existence strongly implying that "bind later" workflow is supported. tblDeleteTable is a real handle-unregister-and-free that also nils the caller's own Table variable (a var parameter, not just const) — defensive against reuse of a freed handle.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle the table will draw into; may be nil (bind later via tblSetPDFInstance). |
AllocRows | Accepted but never used — no row pre-allocation occurs. |
NumCols | Initial column count. |
Width | Initial total table width. |
DefRowHeight | Default row height used by tblAddRow/tblAddRows when their own Height argument is ≤ 0. |
Table | *(Delete only)* var handle; nulled after freeing. |
Return value. tblCreateTable: a new table handle (always succeeds if NumCols/dimensions are otherwise well-formed — no license or document requirement). tblDeleteTable: none (procedure).
C# (P/Invoke)
public static extern IntPtr tblCreateTable(IntPtr IPDF, uint AllocRows, uint NumCols, float Width, float DefRowHeight);
Misc
tblCreateTable
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.