PdfSetPageFormat(pageFormat as String) As Boolean

 

The function sets a predefined page or paper format.

 

Parameters:

 

Name

Type

Description

pageFormat

String

Valid parameter values:

 

FORMAT

Alternative names

Dimensions in points

A3

DINA3

DIN_A3

842.0 x 1191.0

A4

DINA4

DIN_A4

595.0 x 842.0

A5

DINA5

DIN_A5

419.0 x 595.0

B4

DINB4

DIN_B4

709.0 x 1001.0

B5

DINB5

DIN_B5

499.0 x 709.0

B6

DINB6

DIN_B6

354.0 x 499.0

C3

DINC3

DIN_C3

918.0 x 1298.0

C4

DINC4

DIN_C4

649.0 x 918.0

C5

DINC5

DIN_C5

459.0 x 649.0

C6

DINC6

DIN_C6

323.0 x 459.0

C65

DINC65

DIN_C65

323.0 x 649.0

DL

DINDL

DIN_DL

312.0 x 624.0

E4

DINE4

DIN_E4

623.0 x 879.0

E5

DINE5

DIN_E5

439.0 x 624.0

E6

DINE6

DIN_E6

312.0 x 439.0

E65

DINE65

DIN_E65

312.0 x 624.0

M5

DINM5

DIN_M5

439.0 x 632.0

M65

DINM65

DIN_M65

317.0 x 632.0

LEGAL

USLEGAL

US_LEGAL

612.0 x 1008.0

LETTER

USLETTER

US_LETTER

612.0 x 792.0

 

 

 

Returns:

 

Type

Value

Description

Boolean

True or False

Returns True if the page format has been set.

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

 

Example XojoScript:

 

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

 

// sets a predefined page or paper format

Call PdfSetPageformat("E6")  // 312.0 x 439.0

 

// 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,"E6 format pdf-file")

 

// Finalize PDF

Call PdfCloseFile

 

// Open PDF in default viewer

Call PdfLaunch

 

End If