PageFormat

<< Click to Display Table of Contents >>

Navigation:  Layout Functions >

PageFormat

Previous pageReturn to chapter overviewNext page

Sets / returns the page format for the current page. You can set the page format for each page separately. All newly with PageBreak() added pages will have the page format which was specified at last.

property integer VPE.PageFormat

read / write; design & runtime

Possible Values:

one of the constants below

Default:

VPAPER_A4

Example:

VPE instructs the printer during printing, to switch the paper dimensions automatically according to the page dimensions of the VPE Document's currently printed page. Many printers can react on this and choose automatically the right paper from a different paper input bin. If you want to stop VPE from this automatism, you can specify the flag PRINT_NO_AUTO_PAGE_DIMS for the property PrintOptions.

 

Since the PageFormat and the Orientation of the document are independent from the settings of the printer, you can copy the settings of the printer to the document by using one of the following code samples:

 

Copying the printer's page format to the document from the default printer:

VPE.OpenDoc

// the default printer is chosen automatically, so just copy the dimensions

VPE.PageWidth = VPE.DevPaperWidth

VPE.PageHeight = VPE.DevPaperHeight

VPE.PageOrientation = VPE.DevOrientation

 

Copying the printer's page format to the document from a specific printer:

VPE.OpenDoc

// choose "Office Printer 2"

VPE.Device = "Office Printer 2"

VPE.PageWidth = VPE.DevPaperWidth

VPE.PageHeight = VPE.DevPaperHeight

VPE.PageOrientation = VPE.DevOrientation

 

 

Copying the printer's page format to the document from a PRS file:

ActiveX / VCL:

VPE.OpenDoc

// use PRINT_NO_AUTO_PAGE_DIMS, in order to be able to retrieve the

// values for the page dimensions from the PRS file:

VPE.PrintOptions = PRINT_ALL + PRINT_NO_AUTO_PAGE_DIMS

VPE.SetupPrinter "personal settings.prs", PRINTDLG_ONFAIL

VPE.PageWidth = VPE.DevPaperWidth

VPE.PageHeight = VPE.DevPaperHeight

VPE.PageOrientation = VPE.DevOrientation

 

// switch PrintOptions back and let VPE control the printer's page

// dimensions, i.e. clear the flag PRINT_NO_AUTO_PAGE_DIMS

VPE.PrintOptions = PRINT_ALL

 

.NET:

VPE.OpenDoc

// use PRINT_NO_AUTO_PAGE_DIMS, in order to be able to retrieve the

// values for the page dimensions from the PRS file:

VB: VPE.PrintOptions = PrintOptions.All + PrintOptions.NoAutoPageDims

C#: VPE.PrintOptions = PrintOptions.All | PrintOptions.NoAutoPageDims

VPE.SetupPrinter "personal settings.prs", PrintDialogControl.OnFail

VPE.PageWidth = VPE.DevPaperWidth

VPE.PageHeight = VPE.DevPaperHeight

VPE.PageOrientation = VPE.DevOrientation

 

// switch PrintOptions back and let VPE control the printer's page

// dimensions, i.e. clear the flag PRINT_NO_AUTO_PAGE_DIMS

VPE.PrintOptions = PrintOptions.All

 

You will notice that we are using PageWidth and PageHeight in the examples above. The reason is, that this circumvents a bug in many printer drivers, which return wrong values for DevPaperFormat in case a user defined format has been assigned to the printer. Because of this, the construction "VPE.PageFormat = VPE.DevPaperFormat" can not be used reliably. Instead, use the code from the examples above.

 

ActiveX / VCL: PageFormat can be one of the following values:

Constant

Value

Comment

VPAPER_USER_DEFINED

0

User-Defined

VPAPER_A4

-1

A4 Sheet, 210- by 297-millimeters

VPAPER_LETTER

-2

US Letter, 8 1/2- by 11-inches

VPAPER_LEGAL

-3

Legal, 8 1/2- by 14-inches

VPAPER_CSHEET

-4

C Sheet, 17- by 22-inches

VPAPER_DSHEET

-5

D Sheet, 22- by 34-inches

VPAPER_ESHEET

-6

E Sheet, 34- by 44-inches

VPAPER_LETTERSMALL

-7

Letter Small, 8 1/2- by 11-inches

VPAPER_TABLOID

-8

Tabloid, 11- by 17-inches

VPAPER_LEDGER

-9

Ledger, 17- by 11-inches

VPAPER_STATEMENT

-10

Statement, 5 1/2- by 8 1/2-inches

VPAPER_EXECUTIVE

-11

Executive, 7 1/4- by 10 1/2-inches

VPAPER_A3

-12

A3 sheet, 297- by 420-millimeters

VPAPER_A4SMALL

-13

A4 small sheet, 210- by 297-millimeters

VPAPER_A5

-14

A5 sheet, 148- by 210-millimeters

VPAPER_B4

-15

B4 sheet, 250- by 354-millimeters

VPAPER_B5

-16

B5 sheet, 182- by 257-millimeter paper

VPAPER_FOLIO

-17

Folio, 8 1/2- by 13-inch paper

VPAPER_QUARTO

-18

Quarto, 215- by 275-millimeter paper

VPAPER_10X14

-19

10- by 14-inch sheet

VPAPER_11X17

-20

11- by 17-inch sheet

VPAPER_NOTE

-21

Note, 8 1/2- by 11-inches

VPAPER_ENV_9

-22

#9 Envelope, 3 7/8- by 8 7/8-inches

VPAPER_ENV_10

-23

#10 Envelope, 4 1/8- by 9 1/2-inches

VPAPER_ENV_11

-24

#11 Envelope, 4 1/2- by 10 3/8-inches

VPAPER_ENV_12

-25

#12 Envelope, 4 3/4- by 11-inches

VPAPER_ENV_14

-26

#14 Envelope, 5- by 11 1/2-inches

VPAPER_ENV_DL

-27

DL Envelope, 110- by 220-millimeters

VPAPER_ENV_C5

-28

C5 Envelope, 162- by 229-millimeters

VPAPER_ENV_C3

-29

C3 Envelope,  324- by 458-millimeters

VPAPER_ENV_C4

-30

C4 Envelope,  229- by 324-millimeters

VPAPER_ENV_C6

-31

C6 Envelope,  114- by 162-millimeters

VPAPER_ENV_C65

-32

C65 Envelope, 114- by 229-millimeters

VPAPER_ENV_B4

-33

B4 Envelope,  250- by 353-millimeters

VPAPER_ENV_B5

-34

B5 Envelope,  176- by 250-millimeters

VPAPER_ENV_B6

-35

B6 Envelope,  176- by 125-millimeters

VPAPER_ENV_ITALY

-36

Italy Envelope, 110- by 230-millimeters

VPAPER_ENV_MONARCH

-37

Monarch Envelope, 3 7/8- by 7 ½-inches

VPAPER_ENV_PERSONAL

-38

6 3/4 Envelope, 3 5/8- by 6 1/2-inches

VPAPER_FANFOLD_US

-39

US Std Fanfold, 14 7/8- by 11-inches

VPAPER_FANFOLD_STD_GERMAN

-40

German Std Fanfold, 8 1/2- by 12-inches

VPAPER_FANFOLD_LGL_GERMAN

-41

German Legal Fanfold, 8 1/2- by 13-inches

VPAPER_ISO_B4

-42

B4 (ISO) 250 x 353 mm

VPAPER_JAPANESE_POSTCARD

-43

Japanese Postcard 100 x 148 mm

VPAPER_9X11

-44

9 x 11 in

VPAPER_10X11

-45

10 x 11 in

VPAPER_15X11

-46

15 x 11 in

VPAPER_ENV_INVITE

-47

Envelope Invite 220 x 220 mm

VPAPER_RESERVED_48

-48

RESERVED--DO NOT USE

VPAPER_RESERVED_49

-49

RESERVED--DO NOT USE

VPAPER_LETTER_EXTRA

-50

Letter Extra 9 \275 x 12 in

VPAPER_LEGAL_EXTRA

-51

Legal Extra 9 \275 x 15 in

VPAPER_TABLOID_EXTRA

-52

Tabloid Extra 11.69 x 18 in

VPAPER_A4_EXTRA

-53

A4 Extra 9.27 x 12.69 in

VPAPER_LETTER_TRANSVERSE

-54

Letter Transverse 8 \275 x 11 in

VPAPER_A4_TRANSVERSE

-55

A4 Transverse 210 x 297 mm

VPAPER_LETTER_EXTRA_TRANSVERSE

-56

Letter Extra Transverse 9\275 x 12 in

VPAPER_A_PLUS

-57

SuperA/SuperA/A4 227 x 356 mm

VPAPER_B_PLUS

-58

SuperB/SuperB/A3 305 x 487 mm

VPAPER_LETTER_PLUS

-59

Letter Plus 8.5 x 12.69 in

VPAPER_A4_PLUS

-60

A4 Plus 210 x 330 mm

VPAPER_A5_TRANSVERSE

-61

A5 Transverse 148 x 210 mm

VPAPER_B5_TRANSVERSE

-62

B5 (JIS) Transverse 182 x 257 mm

VPAPER_A3_EXTRA

-63

A3 Extra 322 x 445 mm

VPAPER_A5_EXTRA

-64

A5 Extra 174 x 235 mm

VPAPER_B5_EXTRA

-65

B5 (ISO) Extra 201 x 276 mm

VPAPER_A2

-66

A2 420 x 594 mm

VPAPER_A3_TRANSVERSE

-67

A3 Transverse 297 x 420 mm

VPAPER_A3_EXTRA_TRANSVERSE

-68

A3 Extra Transverse 322 x 445 mm

 

 

 

Windows 2000 or Higher:

 

 

VPAPER_DBL_JAPANESE_POSTCARD

-69

Japanese Double Postcard 200 x 148 mm

VPAPER_A6

-70

A6 105 x 148 mm

VPAPER_JENV_KAKU2

-71

Japanese Envelope Kaku #2

VPAPER_JENV_KAKU3

-72

Japanese Envelope Kaku #3

VPAPER_JENV_CHOU3

-73

Japanese Envelope Chou #3

VPAPER_JENV_CHOU4

-74

Japanese Envelope Chou #4

VPAPER_LETTER_ROTATED

-75

Letter Rotated 11 x 8 1/2 in

VPAPER_A3_ROTATED

-76

A3 Rotated 420 x 297 mm

VPAPER_A4_ROTATED

-77

A4 Rotated 297 x 210 mm

VPAPER_A5_ROTATED

-78

A5 Rotated 210 x 148 mm

VPAPER_B4_JIS_ROTATED

-79

B4 (JIS) Rotated 364 x 257 mm

VPAPER_B5_JIS_ROTATED

-80

B5 (JIS) Rotated 257 x 182 mm

VPAPER_JAPANESE_POSTCARD_ROTATED

-81

Japanese Postcard Rotated 148 x 100 mm

VPAPER_DBL_JAPANESE_POSTCARD_ROTATED

-82

Double Japanese Postcard Rotated 148 x 200mm

VPAPER_A6_ROTATED

-83

A6 Rotated 148 x 105 mm

VPAPER_JENV_KAKU2_ROTATED

-84

Japanese Envelope Kaku #2 Rotated

VPAPER_JENV_KAKU3_ROTATED  -85

-85

Japanese Envelope Kaku #3 Rotated

VPAPER_JENV_CHOU3_ROTATED

-86

Japanese Envelope Chou #3 Rotated

VPAPER_JENV_CHOU4_ROTATED

-87

Japanese Envelope Chou #4 Rotated

VPAPER_B6_JIS

-88

B6 (JIS) 128 x 182 mm

VPAPER_B6_JIS_ROTATED

-89

B6 (JIS) Rotated 182 x 128 mm

VPAPER_12X11

-90

12 x 11 in

VPAPER_JENV_YOU4

-91

Japanese Envelope You #4

VPAPER_JENV_YOU4_ROTATED

-92

Japanese Envelope You #4 Rotated

VPAPER_P16K

-93

PRC 16K 146 x 215 mm

VPAPER_P32K

-94

PRC 32K 97 x 151 mm

VPAPER_P32KBIG

-95

PRC 32K(Big) 97 x 151 mm

VPAPER_PENV_1

-96

PRC Envelope #1 102 x 165 mm

VPAPER_PENV_2

-97

PRC Envelope #2 102 x 176 mm

VPAPER_PENV_3

-98

PRC Envelope #3 125 x 176 mm

VPAPER_PENV_4

-99

PRC Envelope #4 110 x 208 mm

VPAPER_PENV_5

-100

PRC Envelope #5 110 x 220 mm

VPAPER_PENV_6

-101

PRC Envelope #6 120 x 230 mm

VPAPER_PENV_7

-102

PRC Envelope #7 160 x 230 mm

VPAPER_PENV_8

-103

PRC Envelope #8 120 x 309 mm

VPAPER_PENV_9

-104

PRC Envelope #9 229 x 324 mm

VPAPER_PENV_10

-105

PRC Envelope #10 324 x 458 mm

VPAPER_P16K_ROTATED

-106

PRC 16K Rotated

VPAPER_P32K_ROTATED

-107

PRC 32K Rotated

VPAPER_P32KBIG_ROTATED

-108

PRC 32K(Big) Rotated

VPAPER_PENV_1_ROTATED

-109

PRC Envelope #1 Rotated 165 x 102 mm

VPAPER_PENV_2_ROTATED

-110

PRC Envelope #2 Rotated 176 x 102 mm

VPAPER_PENV_3_ROTATED

-111

PRC Envelope #3 Rotated 176 x 125 mm

VPAPER_PENV_4_ROTATED

-112

PRC Envelope #4 Rotated 208 x 110 mm

VPAPER_PENV_5_ROTATED

-113

PRC Envelope #5 Rotated 220 x 110 mm

VPAPER_PENV_6_ROTATED

-114

PRC Envelope #6 Rotated 230 x 120 mm

VPAPER_PENV_7_ROTATED

-115

PRC Envelope #7 Rotated 230 x 160 mm

VPAPER_PENV_8_ROTATED

-116

PRC Envelope #8 Rotated 309 x 120 mm

VPAPER_PENV_9_ROTATED

-117

PRC Envelope #9 Rotated 324 x 229 mm

VPAPER_PENV_10_ROTATED

-118

PRC Envelope #10 Rotated 458 x 324 mm

 

.NET, Java, PHP, Python, Ruby, etc.: PageFormat can be one of the following values

public enum PageFormat

{

A4,

A4 Sheet, 210- by 297-millimeters

Letter,

US Letter, 8 1/2- by 11-inches

Legal,

Legal, 8 1/2- by 14-inches

CSheet,

C Sheet, 17- by 22-inches

DSheet,

D Sheet, 22- by 34-inches

ESheet,

E Sheet, 34- by 44-inches

LetterSmall,

Letter Small, 8 1/2- by 11-inches

Tabloid,

Tabloid, 11- by 17-inches

Ledger,

Ledger, 17- by 11-inches

Statement,

Statement, 5 1/2- by 8 1/2-inches

Executive,

Executive, 7 1/4- by 10 1/2-inches

A3,

A3 sheet, 297- by 420-millimeters

A4Small,

A4 small sheet, 210- by 297-millimeters

A5,

A5 sheet, 148- by 210-millimeters

B4,

B4 sheet, 250- by 354-millimeters

B5,

B5 sheet, 182- by 257-millimeter paper

Folio,

Folio, 8 1/2- by 13-inch paper

Quarto,

Quarto, 215- by 275-millimeter paper

Standard10x14,

10- by 14-inch sheet

Standard11x17,

11- by 17-inch sheet

Note,

Note, 8 1/2- by 11-inches

Envelope9,

#9 Envelope, 3 7/8- by 8 7/8-inches

Envelope10,

#10 Envelope, 4 1/8- by 9 1/2-inches

Envelope11,

#11 Envelope, 4 1/2- by 10 3/8-inches

Envelope12,

#12 Envelope, 4 3/4- by 11-inches

Envelope14,

#14 Envelope, 5- by 11 1/2-inches

EnvelopeDL,

DL Envelope, 110- by 220-millimeters

EnvelopeC5,

C5 Envelope, 162- by 229-millimeters

EnvelopeC3,

C3 Envelope,  324- by 458-millimeters

EnvelopeC4,

C4 Envelope,  229- by 324-millimeters

EnvelopeC6,

C6 Envelope,  114- by 162-millimeters

EnvelopeC65,

C65 Envelope, 114- by 229-millimeters

EnvelopeB4,

B4 Envelope,  250- by 353-millimeters

EnvelopeB5,

B5 Envelope,  176- by 250-millimeters

EnvelopeB6,

B6 Envelope,  176- by 125-millimeters

EnvelopeItaly,

Italy Envelope, 110- by 230-millimeters

EnvelopeMonarch,

Monarch Envelope, 3 7/8- by 7 1/2-inches

EnvelopePersonal,

6 3/4 Envelope, 3 5/8- by 6 1/2-inches

FanfoldUS,

US Std Fanfold, 14 7/8- by 11-inches

FanfoldStdGerman,

German Std Fanfold, 8 1/2- by 12-inches

FanfoldLglGerman,

German Legal Fanfold, 8 1/2- by 13-inches

UserDefined,

User Defined

IsoB4,

B4 (ISO) 250 x 353 mm

JapanesePostcard,

Japanese Postcard 100 x 148 mm

Standard9x11,

9 x 11 in

Standard10x11,

10 x 11 in

Standard15x11,

15 x 11 in

EnvelopeInvite,

Envelope Invite 220 x 220 mm

Reserved48,

RESERVED--DO NOT USE

Reserved49,

RESERVED--DO NOT USE

LetterExtra,

Letter Extra 9 \275 x 12 in

LegalExtra,

Legal Extra 9 \275 x 15 in

TabloidExtra,

Tabloid Extra 11.69 x 18 in

A4Extra,

A4 Extra 9.27 x 12.69 in

LetterTransverse,

Letter Transverse 8 \275 x 11 in

A4Transverse,

A4 Transverse 210 x 297 mm

LetterExtraTransverse,

Letter Extra Transverse 9\275 x 12 in

APlus,

SuperA/SuperA/A4 227 x 356 mm

BPlus,

SuperB/SuperB/A3 305 x 487 mm

LetterPlus,

Letter Plus 8.5 x 12.69 in

A4Plus,

A4 Plus 210 x 330 mm

A5Transverse,

A5 Transverse 148 x 210 mm

B5Transverse,

B5 (JIS) Transverse 182 x 257 mm

A3Extra,

A3 Extra 322 x 445 mm

A5Extra,

A5 Extra 174 x 235 mm

B5Extra,

B5 (ISO) Extra 201 x 276 mm

A2,

A2 420 x 594 mm

A3Transverse,

A3 Transverse 297 x 420 mm

A3ExtraTransverse,

A3 Extra Transverse 322 x 445 mm

 

 

Windows 2000 or Higher:

 

DblJapanesePostcard,

Japanese Double Postcard 200 x 148 mm

A6,

A6 105 x 148 mm

JapaneseEnvelopeKaku2,

Japanese Envelope Kaku #2

JapaneseEnvelopeKaku3,

Japanese Envelope Kaku #3

JapaneseEnvelopeChou3,

Japanese Envelope Chou #3

JapaneseEnvelopeChou4,

Japanese Envelope Chou #4

LetterRotated,

Letter Rotated 11 x 8 1/2 in

A3Rotated,

A3 Rotated 420 x 297 mm

A4Rotated,

A4 Rotated 297 x 210 mm

A5Rotated,

A5 Rotated 210 x 148 mm

B4JisRotated,

B4 (JIS) Rotated 364 x 257 mm

B5JisRotated,

B5 (JIS) Rotated 257 x 182 mm

JapanesePostcardRotated,

Japanese Postcard Rotated 148 x 100 mm

DblJapanesePostcardRotated,

Double Japanese Postcard Rotated 148 x 200 mm

A6Rotated,

A6 Rotated 148 x 105 mm

JapaneseEnvelopeKaku2Rotated,

Japanese Envelope Kaku #2 Rotated

JapaneseEnvelopeKaku3Rotated,

Japanese Envelope Kaku #3 Rotated

JapaneseEnvelopeChou3Rotated,

Japanese Envelope Chou #3 Rotated

JapaneseEnvelopeChou4Rotated,

Japanese Envelope Chou #4 Rotated

B6Jis,

B6 (JIS) 128 x 182 mm

B6JisRotated,

B6 (JIS) Rotated 182 x 128 mm

Standard12x11,

12 x 11 in

JapaneseEnvelopeYou4,

Japanese Envelope You #4

JapaneseEnvelopeYou4Rotated,

Japanese Envelope You #4 Rotated

Prc16K,

PRC 16K 146 x 215 mm

Prc32K,

PRC 32K 97 x 151 mm

Prc32KBig,

PRC 32K(Big) 97 x 151 mm

PrcEnvelope1,

PRC Envelope #1 102 x 165 mm

PrcEnvelope2,

PRC Envelope #2 102 x 176 mm

PrcEnvelope3,

PRC Envelope #3 125 x 176 mm

PrcEnvelope4,

PRC Envelope #4 110 x 208 mm

PrcEnvelope5,

PRC Envelope #5 110 x 220 mm

PrcEnvelope6,

PRC Envelope #6 120 x 230 mm

PrcEnvelope7,

PRC Envelope #7 160 x 230 mm

PrcEnvelope8,

PRC Envelope #8 120 x 309 mm

PrcEnvelope9,

PRC Envelope #9 229 x 324 mm

PrcEnvelope10,

PRC Envelope #10 324 x 458 m

Prc16KRotated,

PRC 16K Rotated

Prc32KRotated,

PRC 32K Rotated

Prc32KBigRotated,

PRC 32K(Big) Rotated

PrcEnvelope1Rotated,

PRC Envelope #1 Rotated 165 x 102 mm

PrcEnvelope2Rotated,

PRC Envelope #2 Rotated 176 x 102 mm

PrcEnvelope3Rotated,

PRC Envelope #3 Rotated 176 x 125 mm

PrcEnvelope4Rotated,

PRC Envelope #4 Rotated 208 x 110 mm

PrcEnvelope5Rotated,

PRC Envelope #5 Rotated 220 x 110 mm

PrcEnvelope6Rotated,

PRC Envelope #6 Rotated 230 x 120 mm

PrcEnvelope7Rotated,

PRC Envelope #7 Rotated 230 x 160 mm

PrcEnvelope8Rotated,

PRC Envelope #8 Rotated 309 x 120 mm

PrcEnvelope9Rotated,

PRC Envelope #9 Rotated 324 x 229 mm

PrcEnvelope10Rotated,

PRC Envelope #10 Rotated 458 x 324 mm

}