Share via


PosPrinter.TransactionPrint Method

10/6/2010

Enters or exits transaction mode.

Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)

Syntax

'Declaration
Public MustOverride Sub TransactionPrint ( _
    station As PrinterStation, _
    control As PrinterTransactionControl _
)
public abstract void TransactionPrint (
    PrinterStation station,
    PrinterTransactionControl control
)
public:
virtual void TransactionPrint (
    PrinterStation station, 
    PrinterTransactionControl control
) abstract
public abstract void TransactionPrint (
    PrinterStation station, 
    PrinterTransactionControl control
)
public abstract function TransactionPrint (
    station : PrinterStation, 
    control : PrinterTransactionControl
)

Parameters

  • station
    The printer station to be used. Possible values are defined by the PrinterStation enumeration. Valid values are as follows: PrinterStation.Journal, PrinterStation.Receipt, or PrinterStation.Slip.
  • control
    Transaction control. Possible values are defined by the PrinterTransactionControl enumeration. See in this topic.

Remarks

If control is set to PrinterTransactionControl.Transaction, then transaction mode is entered. Later calls to the PrintNormal, CutPaper, RotatePrint, PrintBarCode, and PrintBitmap methods will buffer the print data (either at the printer or the service object, depending on the printer capabilities) until TransactionPrint is called by using the control parameter set to PrinterTransactionControl.Normal. (In this case, the print methods only validate the method parameters and buffer the data. They do not start printing. Also, the value of the AsyncMode property does not affect their operation: No OutputID will be assigned to the request, nor will an OutputCompleteEvent be raised.)

If control is PrinterTransactionControl.Normal, then transaction mode is exited. If some data was buffered by calls to the methods PrintNormal, CutPaper, RotatePrint, PrintBarCode, and PrintBitmap, the buffered data is printed. The transaction is treated as one message.

TransactionPrint is performed synchronously if AsyncMode is false, and asynchronously if AsyncMode is true.

Calling the ClearOutput method cancels transaction mode. Any buffered print lines are also cleared.

Before it calls this method, the application must open, claim, and enable the device.

TransactionPrint may throw a PosControlException with the following ErrorCodes:

Value

Meaning

Busy

Cannot perform while output is in progress. (Can be returned only if AsyncMode is false and control is PrinterTransactionControl.Normal.)

Illegal

One of the following conditions has occurred:

  • The printer does not support transactions (that is, the CapTransaction property is set to false).

  • The specified station is invalid—it must be PrinterStation.Journal, PrinterStation.Receipt, or PrinterStation.Slip.

  • The specified station is not supported (that is, the appropriate CapJrnPresent, CapSlpPresent or CapRecPresent property is set to false).

  • The printer is currently in Insertion mode.

  • The printer is currently in Removal mode.

  • The control parameter contains an invalid value.

Extended

ExtendedErrorCoverOpen: The printer cover is open. (Can be returned only if AsyncMode is false.)

ExtendedErrorJrnEmpty: The journal station was specified but is out of paper. (Can be returned only if AsyncMode is false.)

ExtendedErrorJrnCartridgeEmpty: A journal cartridge is empty. (Can be returned only if AsyncMode is false.)

ExtendedErrorJrnCartridgeRemoved: A journal cartridge is removed. (Can be returned only if AsyncMode is false.)

ExtendedErrorJrnHeadCleaning: A journal head is being cleaned. (Can be returned only if AsyncMode is false.)

ExtendedErrorRecEmpty: The receipt station was specified but is out of paper. (Can be returned only if AsyncMode is false.)

ExtendedErrorRecCartridgeEmpty: A receipt cartridge is empty. (Can be returned only if AsyncMode is false.)

ExtendedErrorRecCartridgeRemoved: A receipt cartridge is removed. (Can be returned only if AsyncMode is false.)

ExtendedErrorRecHeadCleaning: A receipt head is being cleaned. (Can be returned only if AsyncMode is false.)

ExtendedErrorSlpEmpty: The slip station was specified, but a form is not inserted.(Can be returned only if AsyncMode is false.)

ExtendedErrorSlpCartridgeEmpty: A slip cartridge is empty. (Can be returned only if AsyncMode is false.)

ExtendedErrorSlpCartridgeRemoved: A slip cartridge is removed. (Can be returned only if AsyncMode is false.)

ExtendedErrorSlpHeadCleaning: A slip head is being cleaned. (Can be returned only if AsyncMode is false.)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.

See Also

Reference

PosPrinter Class
PosPrinter Members
Microsoft.PointOfService Namespace