PdfTableGetHeight(tblHandle As Integer) As Double

 

The function returns the full height of the table.

 

The function must be called within an open page.

 

Parameters:

 

Name

Type

Description

tblHandle

Integer

The identification number (handle) of a table, obtained from the PdfTableCreate function.

 

Returns:

 

Type

Value

Description

Double

>= 0.0

If the function succeeds the return value is the height of the table that was drawn so that additional contents can be drawn below the table if necessary.

-1

If the function fails then the return value is -1.

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

Used in:

 

XojoScript Name

GUID

Create Seminar Invoice With Slip As PDF

739DA58E-17EE-41CE-BB54-E7362CFE17D4

Create Seminar Invoice As PDF

2C3F7F29-A29A-4338-ACF5-51894B709DA5

 

Hint: You can find references to XojoScripts which make use of this function by sending the following SQL statement to the database:

Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%PdfTableGetHeight%'

 

Example XojoScript:

 

// Create pdf file and add table with 5 rows

If PdfStart("testfile.pdf") > 0 Then

 

// Set top top-left as 0,0 coordinates

PdfSetPageCoordsTopDown

 

// Vertical position

Dim y As Double = 30.0

 

Dim hTbl As Integer = PdfTableCreate(1,1,200.0,9.0)

If hTbl >= 0 Then

 

// Set outer border

Call PdfTableSetBorderWidth(hTbl,-1, -1, 0.5, 0.5, 0.5, 0.5)

 

// Set inner gridlines

Call PdfTableSetGridWidth(hTbl, 0.5,0.5)

 

// Add 5 rows of 15.0 points row height

Call PdfTableAddRows(hTbl,5,15.0)

 

// Draw the table to pdf, at coordinates x=30 y=30

Call PdfTableDraw(hTbl,30.0,y,0.0) // 0.0 = avoid pagebreaks

 

// Calculate new vertical position for text below table

y = y + PdfTableGetHeight(hTbl) + 10.0

 

End If // hTbl >= 0

 

// Set output font and color

PdfSetFont("Arial","Regular",10.0)

Call PdfSetFillColor("&c00000000") // black textcolor

 

// write a text

Call PdfWriteText(30.0,y,"Table 1")

 

// Finalize PDF

Call PdfCloseFile

 

// Open PDF in default viewer

Call Pdflaunch

 

End If // PdfStart("testfile.pdf")