PosPrinter.PrintImmediate Method (POS for .NET v1.12 SDK Documentation)

2/27/2008

Prints the string immediately that is specified for data on the printer station specified by station.

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

Syntax

'Declaration
Public MustOverride Sub PrintImmediate ( _
    station As PrinterStation, _
    data As String _
)
public abstract void PrintImmediate (
    PrinterStation station,
    string data
)
public:
virtual void PrintImmediate (
    PrinterStation station, 
    String^ data
) abstract
public abstract void PrintImmediate (
    PrinterStation station, 
    String data
)
public abstract function PrintImmediate (
    station : PrinterStation, 
    data : String
)

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.
  • data
    The characters to be printed. May consist of printable characters, escape sequences, carriage returns (13 decimal), and new line / line feed (10 decimal).

Remarks

PrintImmediate tries to print its data immediately—that is, as the very next printer operation. PrintImmediate may be called when asynchronous output is outstanding. PrintImmediate is primarily intended for use in exception conditions when asynchronous output is outstanding, such as in an error event handler.

Special character values within data is as follows:

Value

Meaning

Newline / Line Feed (10 Decimal)

Print any data in the line buffer, and feed to the next print line. (A carriage return is not required in order to print the line.)

Carriage Return (13 Decimal)

If a carriage return immediately comes before a line feed, or if the line buffer is empty, then it is ignored.

Otherwise, the line buffer is printed and the printer does not feed to the next print line.

On some printers, print without feed may be directly supported.

On others, a print may always feed to the next line. In this case, the service object will print the line buffer and perform a reverse line feed if supported.

If the printer does not support either of these features, then the carriage return functions like a line feed.

The ValidateData method can be used to determine whether a carriage return without line feed is possible, and whether a reverse line feed is required to support it.

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

PrintImmediate may throw a PosControlException with the following ErrorCodes:

Value

Meaning

Illegal

One of the following conditions has occurred:

  • The specified station is invalid.

  • The current rotation is invalid—it can only be Normal or Rotate180.

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

Extended

ExtendedErrorCoverOpen: The printer cover is open.

ExtendedErrorJrnEmpty: The journal station was specified but is out of paper.

ExtendedErrorJrnCartridgeEmpty: A journal cartridge is empty.

ExtendedErrorJrnCartridgeRemoved: A journal cartridge is removed.

ExtendedErrorJrnHeadCleaning: A journal head is being cleaned.

ExtendedErrorRecEmpty: The receipt station was specified but is out of paper.

ExtendedErrorRecCartridgeEmpty: A receipt cartridge is empty.

ExtendedErrorRecCartridgeRemoved: A receipt cartridge is removed.

ExtendedErrorRecHeadCleaning: A receipt head is being cleaned.

ExtendedErrorSlpEmpty: The slip station was specified, but a form is not inserted.

ExtendedErrorSlpCartridgeEmpty: A slip cartridge is empty.

ExtendedErrorSlpCartridgeRemoved: A slip cartridge is removed.

ExtendedErrorSlpHeadCleaning: A slip head is being cleaned.

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
CapJrnPresent
CapSlpPresent
PrintNormal
PrintTwoNormal
ValidateData