VpeSetPrintOptions

<< Click to Display Table of Contents >>

Navigation:  Printing Functions >

VpeSetPrintOptions

Previous pageReturn to chapter overviewNext page

[Windows platform only; not supported by the Community Edition]

Allows to set several print options. This preset is also active if the user pushes the print-button in the toolbar, or if the method VpeSetupPrinter() is called.

void  VpeSetPrintOptions(

VpeHandle hDoc,

long flags

)

VpeHandle hDoc

Document Handle

long flags

a combination of the following values:

Constant Name

Value

Comment

PRINT_ALL

0

print all pages

PRINT_EVEN

1

print only even pages

PRINT_ODD

2

print only odd pages

PRINT_NOABORTDLG

4

show no abort / progress dialog during printing

PRINT_NO_AUTO_PAGE_DIMS

16

VPE shall not instruct the printer to use the page dimensions of the currently printed page

Default:

PRINT_ALL

Example:

The several different options can be set by adding the values of each flag. When you assign a new value to PrintOptions, any previous settings will be overwritten:

 

VpeSetPrintOptions(hDoc, PRINT_EVEN);

print only even numbered pages

 

VpeSetPrintOptions(hDoc, PRINT_ODD + PRINT_NOABORTDLG);

print only odd numbered pages and do not show the print-progress dialog

 

VpeSetPrintOptions(hDoc, PRINT_ALL + PRINT_NOABORTDLG + PRINT_NO_AUTO_PAGE_DIMS);

print all pages, do not show the print-progress dialog, do not instruct the printer to use the page dimensions of the currently printed page

 

VpeSetPrintOptions(hDoc, PRINT_ALL);

reset to default

Remarks:

PRINT_NO_AUTO_PAGE_DIMS:

By default, 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 this property.

 

Use PRINT_NO_AUTO_PAGE_DIMS also, if you require that the SetupPrinter() method retrieves the settings for the page dimensions from a PRS file.

 

It has been reported, that some very few printer drivers have a bug and do not print in duplex mode, unless you use PRINT_NO_AUTO_PAGE_DIMS.

 

In order to let the printer accept the automatic selection of user defined page formats (i.e. you are not specifying PRINT_NO_AUTO_PAGE_DIMS), it might be necessary to define a form of the desired page format.

Example: with "Start Menu | Settings | Printers" the window with the installed printers will appear. Right-click on a blank area of the window and choose "Server Properties" from the pop-up menu. In the upcoming dialog, define a custom form of the desired dimensions. For example name it "Test" and set the width to 760 and height to 1280.

In your source code, select the printer and the desired page format like this:

VpeSetDevice(hDoc, "Epson LQ-550");
VpeSetPageWidth(hDoc, 760);
VpeSetPageHeight(hDoc, 1280);

That's it.