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

2/27/2008

Determines whether a data sequence, possibly including one or more escape sequences, is valid for the specified station, before it calls the PrintImmediate, PrintNormal, or PrintTwoNormal methods.

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

Syntax

'Declaration
Public MustOverride Sub ValidateData ( _
    station As PrinterStation, _
    data As String _
)
public abstract void ValidateData (
    PrinterStation station,
    string data
)
public:
virtual void ValidateData (
    PrinterStation station, 
    String^ data
) abstract
public abstract void ValidateData (
    PrinterStation station, 
    String data
)
public abstract function ValidateData (
    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 data to be validated. May include printable data and escape sequences. See Remarks in this topic.

Remarks

ValidateData causes no printing, but is used to determine the capabilities of the station.

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

ValidateData may throw a PosControlException with the following values, as defined by the ValidationResult enumeration:

Value

Meaning

Illegal

One of the following conditions has occurred:

  • The specified station is invalid.

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

  • Some data is not supported. See this topic.

Failure

Some data is not supported--see in this topic.

Cases which cause Illegal to be returned are as follows:

Escape Sequence

Condition

Paper cut

The percentage ‘#’ is not exactly supported: The service object will select the closest supported value.

Feed and Paper cut

The percentage ‘#’ is not precisely supported: The service object will select the closest supported value.

Feed, Paper cut, and Stamp

The percentage ‘#’ is not precisely supported: The service object will select the closest supported value.

Feed units

The unit count ‘#’ is not precisely supported: The service object will select the closest supported value.

Feed reverse

The line count ‘#’ is too large: The service object will select the maximum supported value.

Underline

The thickness ‘#’ is not precisely supported: The service object will select the closest supported value.

Shading

The percentage ‘#’ is not precisely supported: The service object will select the closest supported value.

Scale horizontally

The scaling factor ‘#’ is not supported: The service object will select the closest supported value.

Scale vertically

The scaling factor ‘#’ is not supported: The service object will select the closest supported value.

Data

Condition

data1CRdata2LF

(Where CR is a carriage return and LF is a line feed)

To print data1 and remain on the same line, the service object will print with a line advance, then perform a reverse line feed. The data2 will then overprint data1.

Cases which will cause Failure to be returned are as follows:

Escape Sequence

Condition

(General)

The escape sequence format is not valid.

Paper cut

Not supported.

Feed and Paper cut

Not supported.

Feed, Paper cut, and Stamp

Not supported.

Fire stamp

Not supported.

Print bitmap

Bitmap printing is not supported, or the bitmap number ‘#’ is out of range.

Feed reverse

Not supported.

Font typeface

The font ‘#’ is not supported.

Bold

Not supported.

Underline

Not supported.

Alternate color

Not supported.

Reverse video

Not supported.

Shading

Not supported.

Single high & wide

Not supported.

Double wide

Not supported.

Double high

Not supported.

Double high & wide

Not supported.

RGB color

Not supported.

Data

Condition

data1CRdata2LF

(Where CR is a carriage return and LF is a line feed)

Unable to print data and remain on the same line. The data1 will print on one line, and the data2 will print on the next line.

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
ValidationResult