Interface ILabelPrinter
- Namespace
- Acuit.Pinpoint.Workstation.LabelPrinting
- Assembly
- Acuit.Pinpoint.Workstation.Interfaces.dll
A label printer service.
[Obsolete("This is deprecated and will be removed in a future version; Acuit.Pinpoint.IO.IDeviceRegistry with device type Acuit.Pinpoint.Workstation.LabelPrinting.ILabelPrintDefinition should be used instead.")]
public interface ILabelPrinter
Remarks
This service prints labels using the label printer configured for the station.
Methods
PrintLabelAsync()
Prints a label using the default label template configured for the station.
Task PrintLabelAsync()
Returns
- Task
A task that represents the asynchronous operation.
Remarks
The first time this is called after program startup or after program options have changed, the default label template file will be retrieved from Acuit Pinpoint Server.
Exceptions
- InvalidOperationException
A label printer is not configured, or a default label template is not configured.
- CommunicationException
A communication error occurred while attempting to retrieve the default label template file from the server, or Acuit Pinpoint Server could not read the default label template file.
- TimeoutException
Timed out while attempting to retrieve the default label template file from the server.
- Exception
The label could not be printed due to a printer connection error.
PrintLabelAsync(IDictionary<string, string>)
Prints a label using the default label template configured for the station, replacing placeholders in the template.
Task PrintLabelAsync(IDictionary<string, string> placeholders)
Parameters
placeholders
IDictionary<string, string>The placeholders to replace, as a dictionary of items where each key is the placeholder name (without '{' and '}') and each value is the replacement value.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
Within the ZPL template, placeholders should be specified as named items surrounded by '{' and '}'. Each placeholder may occur zero, once, or multiple times.
The first time this is called after program startup or after program options have changed, the default label template file will be retrieved from Acuit Pinpoint Server.
Exceptions
- ArgumentNullException
placeholders
is null.- InvalidOperationException
A label printer is not configured, or a default label template is not configured.
- CommunicationException
A communication error occurred while attempting to retrieve the default label template file from the server, or Acuit Pinpoint Server could not read the default label template file.
- TimeoutException
Timed out while attempting to retrieve the default label template file from the server.
- Exception
The label could not be printed due to a printer connection error.
PrintLabelAsync(string)
Prints a label.
Task PrintLabelAsync(string zpl)
Parameters
zpl
stringThe ZPL defining the label.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
zpl
is null.- InvalidOperationException
A label printer is not configured.
- Exception
The label could not be printed due to a printer connection error.
RegisterClient(bool)
Registers a client that will use label printing services.
IDisposable RegisterClient(bool usesDefaultLabelTemplate)
Parameters
usesDefaultLabelTemplate
boolWhether the client requires a default label template to be configured.
Returns
- IDisposable
A IDisposable that can be used to unregister this client.
Remarks
Calling this method to register a client is not required to print labels via the other methods, but doing so is recommended, as it will cause appropriate health checks to occur to ensure label printing is configured properly.