Factory method to create the correct ZebraPrinter concrete class based on the printer's control language.
If the SGD value, appl.name, starts with one of the cpclPrefixes, the printer is determined to be a CPCL printer. Otherwise it is considered to be a ZPL printer.
Namespace:
ZSDK_API.PrinterIf the SGD value, appl.name, starts with one of the cpclPrefixes, the printer is determined to be a CPCL printer. Otherwise it is considered to be a ZPL printer.
Assembly: ZSDK_API (in ZSDK_API.dll) Version: 1.1.123.0
Syntax
C# |
---|
public static ZebraPrinter GetInstance( string[] cpclPrefixes, ZebraPrinterConnection connection ) |
Visual Basic (Declaration) |
---|
Public Shared Function GetInstance ( _ cpclPrefixes As String(), _ connection As ZebraPrinterConnection _ ) As ZebraPrinter |
Parameters
- cpclPrefixes
- Type: array<
System..::.String
>[]()[]
An array of possible CPCL version number prefixes.
- connection
- Type: ZSDK_API.Comm..::.ZebraPrinterConnection
An open connection to a printer.
Return Value
An instance of a ZebraPrinter.Exceptions
Exception | Condition |
---|---|
ZSDK_API.ApiException..::.ZebraPrinterConnectionException | If an I/O error occurs. |
ZSDK_API.ApiException..::.ZebraPrinterLanguageUnknownException | If the printer language cannot be determined. |
ZSDK_API.ApiException..::.ZebraGeneralException | If there is an issue writing to the printer. |