PdfTableSetCellPadding(tblHandle As Integer, row As Integer, column As Integer, left As Double, top As Double, right As Double, bottom As Double) As Boolean

 

Sets the cell padding (distance from text to cell-border) of the table, a row or cells.

 

Cell spacing controls the space between cells (outer margin) and cell padding controls the space

between the cell contents and the cell boundary including borders (inner margin).

 

 

Parameters:

 

Name

Type

Description

tblHandle

Integer

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

row

Integer

The index of the row to set cell padding, first row is 0.

If row is -1, all rows are modified

column

Integer

The index of the column to set cell padding, first column is 0.

If column is -1, all columns are modified

left

Double

Width of left cell padding in points

top

Double

Height of top cell padding in points

right

Double

Width of right cell padding in points

bottom

Double

Height of bottom cell padding in points

 

Returns:

 

Type

Value

Description

Boolean

True or False

Returns True when cell padding successfully has been applied

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

 

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

 

Example XojoScript:

 

Dim width As Double = 200.0

Dim rows As Integer = 3

Dim x,y As Double = 30.0

 

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

 

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

PdfSetPageCoordsTopDown

 

// Set output font and color

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

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

 

Dim hTbl As Integer = PdfTableCreate(rows,2,width,9.0)

If hTbl >= 0 Then

 

// Set width of first colum, the last column autoadjusts

Call PdfTableSetColumnWidth(hTbl, 0, 20.0,       False)

 

// Set Font, Size and Style for table

Call pdfTableSetFont(hTbl,-1, -1, "Arial", 10.0, "Regular")

 

// Set outer border

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

 

// Set inner gridlines

Call PdfTableSetGridWidth(hTbl, 0.5,0.5)

 

// Setting the cell padding (space between the cell contents and the cell boundary)

 

// PdfTableSetCellPadding( table, row,  column, left, top, right, bottom)

Call PdfTableSetCellPadding(hTbl,-1,    1,       5.0,  0.0, 5.0,   0.0) // column 2 (1st column is 0)

 

// Hold number of PDFTableRows created

Dim rowNum As Integer = 0

 

// Add some contents into cells

For i As Integer = 0 To rows-1

rowNum = PdfTableAddRow(hTbl)

Dim cnt As String = Str(rowNum+1)

Call PdfTableSetCellText(hTbl,rowNum, 0, "Left",   "Top", cnt)

Call PdfTableSetCellText(hTbl,rowNum, 1, "Right",  "Top", "Item" + cnt)

Next

 

// Draw the table out to pdf

Call PdfTableDraw(hTbl,x,y,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")