VpeSetPageOrientation

<< Click to Display Table of Contents >>

Navigation:  Layout Functions >

VpeSetPageOrientation

Previous pageReturn to chapter overviewNext page

Sets  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.

void VpeSetPageOrientation(

VpeHandle hDoc,

int orientation

)

VpeHandle hDoc

Document Handle

int orientation

can be one of the following values:

Constant Name

Value

Comment

VORIENT_PORTRAIT  

1

 

VORIENT_LANDSCAPE

2

 

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:

VpeHandle hDoc = VpeOpenDoc(hwnd, "title", 0);

VpeSetupPrinter(hDoc, "personal settings.prs", PRINTDLG_ONFAIL);

VpeSetPageFormat(hDoc, VpeGetDevPaperFormat(hDoc));

VpeSetPageOrientation(hDoc, VpeGetDevOrientation(hDoc));

 

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:

VpeSetPageOrientation(hDoc, VORIENT_LANDSCAPE)

Sets the orientation for the current page to Landscape.

 

VpePageBreak(hDoc)

VpeSetPageOrientation(hDoc, VORIENT_PORTRAIT)

Adds a new page and sets the Orientation of the new added page to Portrait.

 

VpePageBreak(hDoc)

VpeSetPageOrientation(hDoc, VORIENT_LANDSCAPE)

Adds a third page and sets the Orientation of the new added page back to Landscape.