PdfLineDraw(x1 As Double, y1 As Double, x2 As Double, y2 As Double) As Boolean

 

Draw a line from coordinates x1,y1 to x2,y2.

 

If the coordinate system is bottom-up the point X, Y defines the lower left corner of the bounding rectangle.

If the coordinate system is top-down it defines the upper left corner.

 

 

Parameters:

 

Name

Type

Description

x1

Double

Starting point of line, from Left in points

y1

Double

Starting point of line, from Top in points (If PdfSetPageCoordsTopDown is set)

Starting point of line, from Bottom in points (If PdfSetPageCoordsBottomUp is set)

x2

Double

Ending point of line, from Left in points

y2

Double

Ending point of line, from Top in points (If PdfSetPageCoordsTopDown is set)

Ending point of line, from Bottom in points (If PdfSetPageCoordsBottomUp is set)

 

Returns:

 

Type

Value

Description

Boolean

True or False

Returns True if the line has been drawn.

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

 

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")

 

// Set new vertical position

y = y + 15.0

 

// draw a horizontal line underneath

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

 

// Finalize PDF

Call PdfcloseFile

 

// Open PDF in default viewer

Call Pdflaunch

 

End If