PdfTableSetGridWidth(tblHandle As Integer, h As double, v As double) As Boolean

 

The function sets the inner grid width of the table.

 

The table grid consists of horizontal and vertical lines which are drawn in the middle of two rows or columns.

The grid lines cover always the entire width or height of the table.

The line widths can be set to different values for the horizontal and vertical lines.

 

The pdf file shown in this picture

is created by the example script below.

 

 

 

 

Parameters:

 

Name

Type

Description

tblHandle

Integer

The identification number (handle) of a table,

obtained from the PdfTableCreate function.

h

Double

The size (thickness) of the tables horizontal gridlines in points, like: 0.5

v

Double

The size (thickness) of the tables vertical gridlines in points, like: 0.5

 

Returns:

 

Type

Value

Description

Boolean

True or False

Returns True if the table grid has been set

Returns False upon failure

 

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

 

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 '%PdfTableSetGridWidth%'

 

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

 

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

If hTbl >= 0 Then

 

// Set outer border around table (all cells)

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)

 

// Set thicker cell border in first row only (0,0)

Call PdfTableSetBorderWidth(hTbl,0, 0, 1.5, 1.5, 1.5, 1.5)

 

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

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

 

End If // hTbl >= 0

 

// Finalize PDF

Call PdfCloseFile

 

// Open PDF in default viewer

Call Pdflaunch

 

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