PdfWriteFText(Align As String, aText As String) As Boolean

 

Write text into an existing pdf object

 

Instead of printing text on a line by line basis it is also possible to output text into a rectangle.

 

 

Parameters:

 

Name

Type

Description

Align

String

Sets text alignment inside of the frame defined by PdfSetTextRect

Align values: Left, Center, Right, Justify

aText

String

Text to be drawn inside of the frame defined by PdfSetTextRect

 

Returns:

 

Type

Value

Description

Boolean

True or False

Returns True if the text has been drawn.

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

 

Example XojoScript:

 

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

 

PdfSetPageCoordsTopDown // Point of origin is top-left

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

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

Dim x,y As Double = 30.0 // Define variables for text position

 

Call PdfSetTextRect(x,y,200.0,-1.0)  // -1 = not breaking to next page

Call PDFwriteFText("LEFT","Oliver Osswald" + eol + "Gruthweg 9" + eol + "4132 Muttenz")

 

// Finalize PDF

Call PdfCloseFile

 

// Open pdf in default pdf viewer

Call Pdflaunch

 

End If