Share via


PosPrinter.RotatePrint Method

2/27/2008

Enters or exits rotated print mode.

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

Syntax

'Declaration
Public MustOverride Sub RotatePrint ( _
    station As PrinterStation, _
    rotation As PrintRotation _
)
public abstract void RotatePrint (
    PrinterStation station,
    PrintRotation rotation
)
public:
virtual void RotatePrint (
    PrinterStation station, 
    PrintRotation rotation
) abstract
public abstract void RotatePrint (
    PrinterStation station, 
    PrintRotation rotation
)
public abstract function RotatePrint (
    station : PrinterStation, 
    rotation : PrintRotation
)

Parameters

  • station
    The printer station to be used. Possible values are defined by the PrinterStation enumeration. Valid values are as follows: PrinterStation.Receipt or PrinterStation.Slip.
  • rotation
    Direction of rotation. Possible values are defined by the PrintRotation enumeration.

Remarks

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

If rotation is set to PrintRotation.Rotate180, then upside-down print mode is entered. Later calls to PrintNormal or PrintImmediate will print the data upside-down until RotatePrint is called by using the rotation parameter set to PrintRotation.Normal.

Each print line is rotated by 180 degrees. Lines are printed in the order that they are sent to the service object, with the start of each line justified at the right margin of the printer station. Only print methods PrintNormal and PrintImmediate can be used while in upside-down print mode.

If rotation is set to PrintRotation.Right90 or PrintRotation.Left90, sideways print mode is entered. Later calls to PrintNormal will buffer the print data (either at the printer or the service object, depending on the printer capabilities) until RotatePrint is called by using the rotation parameter set to PrintRotation.Normal. (In this case, PrintNormal only buffers the data. Itit does not start printing. Also, the value of the AsyncMode property does not affect its operation: No OutputID will be assigned to the request, nor will an OutputCompleteEvent event be raised.)

Each print line is rotated by 90 degrees. If the lines are not all the same length, they are justified at the start of each line. Only PrintNormal can be used while in sideways print mode.

If rotation is PrintRotation.Normal, then rotated print mode is exited. If sideways-rotated print mode was in effect and some data was buffered by calls to the PrintNormal method, the buffered data is printed. The rotated block of lines is treated as one message.

Changing the rotation mode may also change the station’s line height, line spacing, line width, and other metrics.

Calling the ClearOutput method cancels rotated print mode. Any buffered sideways-rotated print lines are also cleared.

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

RotatePrint 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.)

Illegal

One of the following conditions has occurred:

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

  • The station does not support the specified rotation.

Extended

ExtendedErrorCoverOpen: The printer cover is open. (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
CapRecPresent
CapSlpPresent
PosPrinter.PrintNormal Method
PosPrinter.PrintImmediate Method
PrinterStation
PrintRotation