VpeSetDevPaperBin

<< Click to Display Table of Contents >>

Navigation:  Device Control Properties >

VpeSetDevPaperBin

Previous pageReturn to chapter overviewNext page

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

Selects a paper bin for the currently selected output device.

int VpeSetDevPaperBin(

VpeHandle hDoc,

int bin_id

)

VpeHandle hDoc

Document Handle

int bin_id

possible values are:

Constant Name

Value

Comment

VBIN_UNTOUCHED

0

 

VBIN_UPPER

1

 

VBIN_ONLYONE

1

 

VBIN_LOWER

2

 

VBIN_MIDDLE

3

 

VBIN_MANUAL

4

 

VBIN_ENVELOPE

5

 

VBIN_ENVMANUAL

6

 

VBIN_AUTO

7

 

VBIN_TRACTOR

8

 

VBIN_SMALLFMT

9

 

VBIN_LARGEFMT

10

 

VBIN_LARGECAPACITY

11

 

VBIN_CASSETTE

14

 

 

Additionally, each printer driver may define its own constants for other bins (see Remarks).

 

Not all of the bin options are available on every printer. Check the printer's documentation for more specific descriptions of these options.

Returns:

Value

Description

True

success

False

failure

Remarks:

In case of an error, LastError is set to VERR_COMMON. An error may occur if the device does not support multiple paper bins.

 

The Bin-ID’s are numeric Windows system constants to identify a bin. Additionally each printer driver may define its own constants for other bins. To retrieve a Bin-ID defined by a printer driver, enumerate all bins with VpeDevEnumPaperBins() and retrieve each Bin-ID associated with a Bin-Entry with VpeGetDevPaperBinID().

 

The DevPaperBin property is available for total control. It is only useful if called while processing the VPE_PRINT_NEWPAGE event. Otherwise the DevPaperBin property is always overridden by the PaperBin property, which is specified separately for each page by calling VpeSetPaperBin(). You should always use VpeSetPaperBin() to change the bin for the printer.

 

It has been reported that several printer drivers - even from respectable manufacturers - do not behave correctly. Our own tests revealed for example that the HP 2200 D driver can only switch once the bin, but thereafter it will not switch the bin again. The HP 5P driver behaves correctly unless multiple copies and collation are selected. If collation is activated, the driver will print all pages except the first multiple times as if non-collation was selected.

Example:

char s[256]

count = VpeDevEnumPaperBins(hDoc) - 1        // initialize enumeration

for i = 0 to count

 // retrieve the name of the i-th paper bin

 VpeGetDevPaperBinName(hDoc, i, s, sizeof(s))

 

 // show each available paper bin name in a separate message box

 MessageBox(s)

 

 // select the bin

 VpeSetDevPaperBin(hDoc, VpeGetDevPaperBinID(hDoc, i))

next i

 

or, to select a bin directly:

VpeSetDevPaperBin(hDoc, VBIN_LOWER)