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.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

ExceptionCondition
ZSDK_API.ApiException..::.ZebraPrinterConnectionExceptionIf an I/O error occurs.
ZSDK_API.ApiException..::.ZebraPrinterLanguageUnknownExceptionIf the printer language cannot be determined.
ZSDK_API.ApiException..::.ZebraGeneralExceptionIf there is an issue writing to the printer.

See Also