float __stdcall tblDrawTable(ITBL Table, float x, float y, float MaxHeight);
function tblDrawTable(const Table: ITBL; x, y, MaxHeight: Single): Single; stdcall;
Purpose. The real drawing entry point — paints the table's rows, starting from the current pagination cursor (RowCursor), onto the document's current page at (x, y) (top-left, PDF points), stopping once MaxHeight would be exceeded — the mechanism the canonical tblGetFirstRow/tblHaveMore/tblDrawTable paging loop (below) is built around.
Description. A genuinely substantial, real renderer — confirmed: per-cell background fill (Cell.HasBg), a stroked border rectangle per cell (using Table.GridH as the line width), word-wrapped text honoring HAlign/VAlign, a genuinely per-cell font name/style (Cell.FontName/FontStyle, falling back to 'Helvetica' if unset) — but a table-wide font *size* (Table.FontSize, confirming the tblSetFontSize finding from Colors, Fonts, Flags, Grid Lines, and Dimensions directly from the drawing side: no cell can render its text at an independent size) — and genuine 90° rotation support (Cell.Orientation = 90 triggers a real rotated word-wrap-along-height + alignment-swapped layout path); this chapter did not confirm whether 180/270 (or other) orientation values are handled by a similar dedicated path or silently treated as unrotated. Requires both Table and Table.Doc (populated only by tblCreateTable's own IPDF argument — see Lifecycle, Rows, Columns, and PDF Binding's tblSetPDFInstance entry for why the separate tblSetPDFInstance call cannot substitute for this) to be valid, and a currently-open page — fails (0.0) otherwise. Genuinely honors MaxHeight for pagination: starts at Table.RowCursor (clamped to ≥ 0), always draws at least one row per call regardless of MaxHeight (preventing an infinite stuck loop if a single row's own height already exceeds MaxHeight), and stops once adding the next row would exceed the remaining budget — per an explicit "G-17: resume from the paging cursor and stop once MaxHeight is exceeded ... Always draw at least one row per call" comment. MaxHeight ≤ 0 draws every remaining row unconditionally in one call.
Parameters.
| Parameter | Description |
|---|---|
Table | Target table handle; must have a real document bound via tblCreateTable's own IPDF argument. |
x, y | Top-left placement in the current page's PDF coordinate space. |
MaxHeight | ≤ 0 draws all remaining rows from the cursor; > 0 draws rows until the next one would exceed this height budget (always at least one row). |
Return value. The actual height drawn (0.0 if Table/Table.Doc/ the current page don't resolve).
C# (P/Invoke)
public static extern float tblDrawTable(IntPtr Table, float x, float y, float MaxHeight);
Misc
tblDrawTable
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.