PdfSetLineWidth(value As double) As Boolean

 

The function sets the line width used to stroke paths.

 

 

Parameters:

 

Name

Type

Description

value

double

The thickness of a line in points as a floating point value, like 0.5

 

Returns:

 

Type

Value

Description

Boolean

True or False

Returns True if the linewidth has been set.

Returns False upon failure

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

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

 

Example XojoScript:

 

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

 

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

PdfSetPageCoordsTopDown

Dim x,y As Double = 30.0

 

// Set output font and color

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

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

 

// write a location and current date

Call PdfWriteText(x,y,"Page 1")

 

// Define thin linewidth

Call PdfSetLineWidth(0.5)

 

// draw a horizontal line

Call PdfLineDraw(x,45.0,x+530,45.0)

 

// define thicker linewith

Call PdfSetLineWidth(1.0)

 

// draw a horizontal line

Call PdfLineDraw(x,48.0,x+530,48.0)

 

// Set back to thin linewidth

Call PdfSetLineWidth(0.5)

 

// draw a horizontal line

Call PdfLineDraw(x,51.0,x+530,51.0)

 

// Finalize PDF

Call PdfcloseFile

 

// Open PDF in default viewer

Call Pdflaunch

 

End If