PdfTableSetFont(tblHandle As Integer, row As Integer, col As Integer, name as String, size as Double, style As String) As Integer

 

The function sets the font that is used to output text in a table.

 

 

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 affected

column

Integer

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

If column is -1, all columns are affected

name

String

The name of the font to be loaded.

This can be either the full name, the postscript name or the family name of the font.

Example: Arial

size

Double

Size of printed font in points as a floating point value, like 12.0

style

String

Possible values:

 

Black

Bold

Condensed

DemiBold

Expanded

ExtraBold

ExtraCondensed

ExtraExpanded

ExtraLight

Italic

Light

Medium

None

Normal

Regular

SemiCondensed

SemiExpanded

Striked

Thin

UltraBlack

UltraCondensed

UltraExpanded

Underlined

VerticalMode

 

 

 

Returns:

 

Type

Value

Description

Integer

1

If the function succeeds the return value is 1

Integer

0

If the function fails the return value is 0

Integer

-2

An unknown exception occured

 

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

 

Example XojoScript:

 

Dim rows As Integer = 3

Dim x,y As Double = 30.0

 

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

 

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

PdfSetFont("Arial","Regular",10.0) // Set output font

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

 

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

If hTbl >= 0 Then

Call PdfTableSetColumnWidth(hTbl, 0, 20.0, False) // Set width of 1st colum; last column autoadjusts

Call PdfTableSetBorderWidth(hTbl,-1, -1, 0.0, 0.5, 0.0, 0.5) // Set outer border

 

Call pdfTableSetFont(hTbl,-1, -1, "Arial", 10.0, "Italic") // Set Font, Size and Style for table

 

// Set inner gridlines

Call PdfTableSetGridWidth(hTbl, 0.5,0.5)

 

// Setting the cell spacing (space between cells)

// i.e. outer margin of the table, a row or cells

 

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

Call PdfTableSetCellSpacing(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

 

Call PdfcloseFile // Finalize PDF

Call Pdflaunch // Open PDF in default viewer

 

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