API referenceReporting

tblGetPDFInstance

Get/set which document a standalone table draws into —

C
void* __stdcall tblGetPDFInstance(ITBL Table);
void __stdcall tblSetPDFInstance(ITBL Table, PPDF IPDF);
Delphi
function tblGetPDFInstance(const Table: ITBL): Pointer; stdcall;
procedure tblSetPDFInstance(const Table: ITBL; const IPDF: PPDF); stdcall;

Purpose. Get/set which document a standalone table draws into — lets a table be created without a document (tblCreateTable(nil, ...)) and bound afterward, or moved to a different document, before tblDrawTable (Table Pagination Cursor, Introspection, and Drawing) is called.

Description. MAJOR VERIFIED BUG: tblSetPDFInstance writes a field that tblDrawTable never reads — the setter has NO effect on whether a table can actually be drawn. tblSetPDFInstance/tblGetPDFInstance exclusively read/write a dedicated PdfInstance field — whose own declaration comment labels it "tblGet/SetPDFInstance round-trip" — while tblDrawTable (Table Pagination Cursor, Introspection, and Drawing) checks and uses a completely different field, Doc, which is populated only by tblCreateTable's own IPDF constructor argument and is never touched by this setter. In the engine, PdfInstance has exactly three references total: its declaration and this get/set pair — it is never read anywhere else, including by tblDrawTable. Practical consequence: a table created via tblCreateTable(nil, ...) (the explicitly-supported "standalone, bind later" workflow) can NEVER be made drawable by calling tblSetPDFInstance afterwardtblDrawTable will keep failing (T.Doc stays nil forever) regardless of how many times tblSetPDFInstance is called. The only way to get a drawable table is to pass a real IPDF directly to tblCreateTable at creation time. tblGetPDFInstance faithfully echoes back whatever was set via the setter — the round-trip itself works — it just has no bearing on the table's real, separate document binding.

Parameters.

ParameterDescription
TableTarget table handle.
IPDF*(Set only)* Stored in a disconnected field — does not affect tblDrawTable's ability to draw the table.

Return value. tblGetPDFInstance: the stored PdfInstance pointer (nil if never set) — disconnected from the table's real drawing-capable document binding. tblSetPDFInstance: none.

C# (P/Invoke)

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

Misc

Exported names

tblGetPDFInstance

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.