PageOrientation

<< Click to Display Table of Contents >>

Navigation:  Layout Functions >

PageOrientation

Previous pageReturn to chapter overviewNext page

Sets / returns the page orientation for the current page. Also all newly with PageBreak() added pages will have this orientation. The orientation is reflected in the preview if PaperView = True. Also the printer will print the page in the specified orientation.

property PageOrientation [integer] VPE.PageOrientation

read / write; design & runtime

Possible Values:

ActiveX / VCL

Value

Enum

Comment

VORIENT_PORTRAIT

1

Portrait

 

VORIENT_LANDSCAPE

2

Landscape

 

Remarks:

Changing the orientation also modifies the OutRect of the current page and the DefOutRect (see also: "Page Margins" in the Programmer's Manual). The rectangles are rotated in a way that the margin spaces are kept the same. For example, if the OutRect and DefOutRect are set in a way, that all margins are 2cm from the paper borders, changing the orientation will keep those borders by rotating the rectangles.

 

This property is independent from DevOrientation. You should always use this function to specify the orientation.

Example:

ActiveX / VCL:

VPE.OpenDoc

VPE.SetupPrinter("personal settings.prs", PRINTDLG_ONFAIL)

VPE.PageFormat = VPE.DevPaperFormat

VPE.PageOrientation = VPE.DevOrientation

 

.NET:

VPE.OpenDoc

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

VPE.PageFormat = VPE.DevPaperFormat

VPE.PageOrientation = VPE.DevOrientation

 

Changing the orientation during the print-job doesn’t work with some (buggy) printer drivers, for example some fax drivers and the HP4 M Plus driver (the HP4 PS driver should work with the HP4 M Plus printer!). Changing the orientation with such drivers on other pages than the very first page might not work. Most printer drivers will work.

 

Printer drivers are manufactured by vendors independent of IDEAL Software; we make no warranty, implied or otherwise, regarding these product’s performance or reliability.

Example:

ActiveX / VCL:

Doc.DevOrientation = VORIENT_LANDSCAPE

Doc.PageBreak()

Doc.DevOrientation = VORIENT_PORTRAIT

Doc.PageBreak()

Doc.DevOrientation = VORIENT_LANDSCAPE

 

.NET:

Doc.DevOrientation = PageOrientation.Landscape

Doc.PageBreak()

Doc.DevOrientation = PageOrientation. Portrait

Doc.PageBreak()

Doc.DevOrientation = PageOrientation.Landscape

 

This example sets the orientation for the current page to Landscape, adds a new page and sets the Orientation of the new added page to Portrait and adds a third page and sets the Orientation of the new added page back to Landscape.