LinePrinter Constructor

Constructs a LinePrinter object with the specified settings.

C#

public LinePrinter(string cmdAttrib, string printerID, string printerURI);

Parameters

Parameter Description
string cmdAttrib A string containing the printer commands and attributes.
string printerID A string containing the printer identifier that is used to load the specific printer commands from the specified commands and attributes string.
string printerURI A string in URI format that specifies how to connect to the printer.

Remarks

The cmdAttrib parameter should contain a string in JSON format. For more information on the JSON format, please refer to the Command and Attribute Format section of the Printer Commands and Attributes User Guide. This SDK provides a printer_profiles.JSON file with standard printer settings for supported receipt printers. You may modify or add printer settings to printer_profiles.JSON and include it in the Assets folder of your application. See the LinePrinterSample included in the SDK for reading printer_profiles.JSON in the Assets folder into a string.

The printerID parameter specifies an identifier which is used to load the specific printer commands from the commands and attributes specified in the cmdAttribFilePath parameter.

The printerURI parameter specifies how to connect to the printer. As of version 1.70, it only supports Bluetooth printing and the URI format is "bt://MacAddress where MacAddress specifies the Bluetooth MAC address in the format of "nn:nn:nn:nn:nn:nn" where each n is a hexadecimal digit, for example, "00:06:AB:3C:25:8F."

Exceptions

PrinterException