Add a new page to a pdf file
The default page format for new created
pages is DIN A4.
However, when changing the
page format, the next page is created in the same format as the previous one.
The page format can be changed
with the function PdfSetPageFormat
Returns:
Type |
Value |
Description |
Boolean |
True
or False |
Returns
True if a new page has successfully
been added to current pdf file |
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 '%PdfAppend%'
Example XojoScript:
If
Not PdfStart("testfile.pdf") > 0 Then
MsgBox "PDF creation of PDF failed!"
Return
End
If
PdfSetPageCoordsTopDown
Dim
x,y As Double
= 30.0
// Set output font for page 1
PdfSetFont("Arial","Regular",10.0)
Call
PdfSetFillColor("&c00000000")
// black textcolor
// write a location and current date and close page 1
Call
PdfWriteText(x,y,"Page
1")
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")
// Finalize PDF
Call
PdfcloseFile
// Show it to the user
Call
Pdflaunch