PdfAddToFilebox(fileboxname As String) As Boolean

 

Add a pdf file to filebox, which has been created with a XojoScript

 

Description: Macbook HD:Users:oliver:Desktop:Screen Shot 2016-01-21 at 15.43.13.png

 

Parameters:

 

Name

Type

Description

fileboxname

String

Name of the filebox, for example: imFB_evt_Files

 

Returns:

 

Type

Value

Description

Boolean

True or False

Returns True if a pdf file has been successfully added to filebox fileboxname

 

Returns False if

-        currently no pdf file exists

-        the filebox does not exist

-        no editing is taking place

-        an unknown error occurred

 

The file can only be added to the filebox when editing or inserting

of a new record or registration is taking place (linkmode, editmode or insertmode)

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

Used in:

 

XojoScript Name

GUID

Create Seminar Invoice As PDF

2C3F7F29-A29A-4338-ACF5-51894B709DA5

Create Seminar Invoice With Slip As PDF

739DA58E-17EE-41CE-BB54-E7362CFE17D4

 

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

 

Example XojoScript:

 

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

MsgBox "PDF creation of PDF failed!"

Return

End If

 

PdfSetPageCoordsTopDown

Dim x,y As Double

 

// Set font, size and color

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

 

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

 

// write a location and current date

x = 400.0

y = 30.0

Call PdfWriteText(x,y,"Basel, " + GetDateLocalized)

 

y = 100.0

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

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

 

// Finalize PDF

Call PdfcloseFile

 

// Show it to the user

Call pdflaunch

 

// Save it into filebox

Call PdfAddToFilebox("imFB_lnk_p04_Files")