Import a pdf file from
templates folder and set it as background.
Parameters:
Name |
Type |
Description |
TemplateName |
String |
The
name of a pdf file which exists in the templates folder. To add
or remove template files, select New
Template Manager from menu Script |
Returns:
Type |
Value |
Description |
Boolean |
True
or False |
Returns
True if the pdf file has been added
to the currently opened pdf file. 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 |
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 '%PdfImportAsTemplate%'
Example XojoScript:
If
PdfStart("testfile.pdf")
> 0 Then
PdfSetPageCoordsTopDown
Dim x,y As Double = 30.0
// Set output font and
color
PdfSetFont("Arial","Regular",18.0)
Call PdfSetFillColor("&c00000000")
// black textcolor
// write a location and
current date
Call PdfWriteText(x,y,"INVOICE")
Call PdfEndpage
// Add a new page
Call PdfAppend
//Define font for new
page and write text
PdfSetFont("Arial","Regular",10.0)
Call PdfWriteText(x,y,"Page
2 with slip")
// Import pdf file from
templates folder
Call PdfImportAsTemplate("SEPA-A4.pdf")
// Finalize PDF
Call PdfcloseFile
// Show it to the user
Call pdflaunch
End
If