PosPrinter PosPrinter PosPrinter PosPrinter Class

Definition

Represents a point-of-service printer.

public : sealed class PosPrinter : IPosPrinter, IClosablepublic sealed class PosPrinter : IPosPrinter, IDisposablePublic NotInheritable Class PosPrinter Implements IPosPrinter, IDisposable// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

To get a PosPrinter object, use the FromIdAsync or GetDefaultAsync static methods.

See the POS printer sample for an example implementation.

Properties

Capabilities Capabilities Capabilities Capabilities

Gets the capabilities of the point-of-service printer.

public : PosPrinterCapabilities Capabilities { get; }public PosPrinterCapabilities Capabilities { get; }Public ReadOnly Property Capabilities As PosPrinterCapabilities// You can use this property in JavaScript.
Value
PosPrinterCapabilities PosPrinterCapabilities PosPrinterCapabilities PosPrinterCapabilities

The capabilities of the point-of-service printer.

See Also

DeviceId DeviceId DeviceId DeviceId

Gets the identifier of the point-of-service printer.

public : PlatForm::String DeviceId { get; }public string DeviceId { get; }Public ReadOnly Property DeviceId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The identifier of the point-of-service printer.

Status Status Status Status

Gets the current status of the power and availability of the point-of-service printer.

public : PosPrinterStatus Status { get; }public PosPrinterStatus Status { get; }Public ReadOnly Property Status As PosPrinterStatus// You can use this property in JavaScript.
Value
PosPrinterStatus PosPrinterStatus PosPrinterStatus PosPrinterStatus

The current status of the power and availability of the point-of-service printer.

See Also

SupportedCharacterSets SupportedCharacterSets SupportedCharacterSets SupportedCharacterSets

Gets the list of character sets that the point-of-service printer supports.

public : IVectorView<uint> SupportedCharacterSets { get; }public IReadOnlyList<uint> SupportedCharacterSets { get; }Public ReadOnly Property SupportedCharacterSets As IReadOnlyList<uint>// You can use this property in JavaScript.
Value
IVectorView<unsigned int> IReadOnlyList<uint> IReadOnlyList<uint> IReadOnlyList<uint>

The list of numeric values for the character sets that the point-of-service-printer supports.

SupportedTypeFaces SupportedTypeFaces SupportedTypeFaces SupportedTypeFaces

Gets the fonts and typefaces that the point-of-service printer supports.

public : IVectorView<string> SupportedTypeFaces { get; }public IReadOnlyList<string> SupportedTypeFaces { get; }Public ReadOnly Property SupportedTypeFaces As IReadOnlyList<string>// You can use this property in JavaScript.
Value
IVectorView<PlatForm::String> IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

The fonts and typefaces that the point-of-service printer supports.

Methods

CheckHealthAsync(UnifiedPosHealthCheckLevel) CheckHealthAsync(UnifiedPosHealthCheckLevel) CheckHealthAsync(UnifiedPosHealthCheckLevel) CheckHealthAsync(UnifiedPosHealthCheckLevel)

Gets the health state of the point-of-service printer asynchronously.

public : IAsyncOperation<PlatForm::String> CheckHealthAsync(UnifiedPosHealthCheckLevel level)public IAsyncOperation<string> CheckHealthAsync(UnifiedPosHealthCheckLevel level)Public Function CheckHealthAsync(level As UnifiedPosHealthCheckLevel) As IAsyncOperation( Of string )// You can use this method in JavaScript.
Parameters
level
UnifiedPosHealthCheckLevel UnifiedPosHealthCheckLevel UnifiedPosHealthCheckLevel UnifiedPosHealthCheckLevel

The type of health check that you want to perform for the point-of-service printer. Only level POSInternal(1) should be used, as any other UnifiedPosHealthCheckLevel levels will result in an error.

Returns

An asynchronous operation that returns the health state of the point-of-service printer. You should display this value in the app interface immediately so the user of the app can interpret the value. For example, the operation returns “OK” as the health state if the state of the point-of-service printer is good.

ClaimPrinterAsync() ClaimPrinterAsync() ClaimPrinterAsync() ClaimPrinterAsync()

Claims the point-of-service printer for use, and gets an instance of the ClaimedPosPrinter class for the point-of-service printer.

public : IAsyncOperation<ClaimedPosPrinter> ClaimPrinterAsync()public IAsyncOperation<ClaimedPosPrinter> ClaimPrinterAsync()Public Function ClaimPrinterAsync() As IAsyncOperation( Of ClaimedPosPrinter )// You can use this method in JavaScript.
Returns

Remarks

The claim is cooperatively managed, so multiple concurrent apps can negotiate which app owns the claim.

Close() Close() Close() Close()

Close the POS printer session. For C++ and JavaScript, use Close(). For C# and Visual Basic, use Dispose().

public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()

FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String)

Creates a PosPrinter object for point-of-service printer with the specified DeviceInformation.Id.

public : static IAsyncOperation<PosPrinter> FromIdAsync(PlatForm::String deviceId)public static IAsyncOperation<PosPrinter> FromIdAsync(String deviceId)Public Static Function FromIdAsync(deviceId As String) As IAsyncOperation( Of PosPrinter )// You can use this method in JavaScript.
Parameters
deviceId
PlatForm::String String String String

The DeviceInformation.Id that identifies a specific point-of-service printer.

Returns

The point-of-service printer that the unique device identifier identifies. Returns a null object in the following cases:

  • The specific printer is not found.
  • Access is denied to the existing printer. The user can deny access to a device, which is not treated as an exception.

Remarks

The app package manifest must include the PointofService device capability. If the manifest omits this capability, this method returns null and no exception is generated.

GetDefaultAsync() GetDefaultAsync() GetDefaultAsync() GetDefaultAsync()

Gets the default paired or locally-connected printer.

public : static IAsyncOperation<PosPrinter> GetDefaultAsync()public static IAsyncOperation<PosPrinter> GetDefaultAsync()Public Static Function GetDefaultAsync() As IAsyncOperation( Of PosPrinter )// You can use this method in JavaScript.
Returns

Remarks

The app manifest must include the PointofService device capability. If the manifest omits this capability, this method returns null and no exception is generated.

GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector()

Gets an Advanced Query Syntax (AQS) string that you can use to list the available point-of-service printers.

public : static PlatForm::String GetDeviceSelector()public static string GetDeviceSelector()Public Static Function GetDeviceSelector() As string// You can use this method in JavaScript.
Returns
PlatForm::String string string string

An Advanced Query Syntax (AQS) string that you can use to list the available point-of-service printers.

GetDeviceSelector(PosConnectionTypes) GetDeviceSelector(PosConnectionTypes) GetDeviceSelector(PosConnectionTypes) GetDeviceSelector(PosConnectionTypes)

Gets an Advanced Query Syntax (AQS) string that you can use to list the point-of-service printers available over the specified connection types

public : static PlatForm::String GetDeviceSelector(PosConnectionTypes connectionTypes)public static string GetDeviceSelector(PosConnectionTypes connectionTypes)Public Static Function GetDeviceSelector(connectionTypes As PosConnectionTypes) As string// You can use this method in JavaScript.
Parameters
connectionTypes
PosConnectionTypes PosConnectionTypes PosConnectionTypes PosConnectionTypes

A list of the connection types to check for available point-of-service printers.

Returns
PlatForm::String string string string

An Advanced Query Syntax (AQS) string that is used to enumerate the point-of-service printers available over the specified connection types

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

GetStatisticsAsync(IIterable) GetStatisticsAsync(IIterable) GetStatisticsAsync(IIterable) GetStatisticsAsync(IIterable)

Gets the specified statistics from the point-of-service printer.

public : IAsyncOperation<PlatForm::String> GetStatisticsAsync(IIterable<PlatForm::String> statisticsCategories)public IAsyncOperation<string> GetStatisticsAsync(IEnumerable<String> statisticsCategories)Public Function GetStatisticsAsync(statisticsCategories As IEnumerable<String>) As IAsyncOperation( Of string )// You can use this method in JavaScript.
Parameters
statisticsCategories
IIterable<PlatForm::String> IEnumerable<String> IEnumerable<String> IEnumerable<String>

The list of statistics to retrieve.

  • An empty string ("") retrieves all statistics.
  • "U_" retrieves all UnifiedPOS defined statistics.
  • "M_" retrieves all manufacturer defined statistics.
  • "name1" and/or "name2" retrieves specific named statistics as defined by the UnifiedPOS or manufacturer.
  • Any combination of individual and groups names ("name3", "U_", "M_").
Returns

The requested statistics.

Events

StatusUpdated StatusUpdated StatusUpdated StatusUpdated

Occurs when the status of the power or availability of the point-of-service printer changes.

public : event TypedEventHandler StatusUpdated<PosPrinter,  PosPrinterStatusUpdatedEventArgs>public event TypedEventHandler StatusUpdated<PosPrinter,  PosPrinterStatusUpdatedEventArgs>Public Event StatusUpdated<PosPrinter,  PosPrinterStatusUpdatedEventArgs>// You can use this event in JavaScript.

See Also