Introduction
This tip is about printing/displaying different characters on POS LineDisplay
(Customer Display) or POS Printer.
While working with POS Device, we always face problems while printing currency symbols or different regional characters. It becomes tough to find an easy alternative for them.
In order to work with POS.Net Devices, we have a help section from MSDN too, but have a look here which will easily guide us to Character Printing.
Prerequisites
- Knowledge of POS for .NET and how to configure POS Device
- Device Configuration Details (
DeviceName
)
Using the Code
POS Devices supports many characterSets
, list of charactersets
supported depend upon the manufacturer / vendor. To identify the list of charactersets
supported by Device, we can identify from CharacterSetList
property.
var characterSetList = lineDisplayControl.axOPOSDISP1.CharacterSetList.Split(new string[] { "," },
StringSplitOptions.RemoveEmptyEntries);
foreach (var item in characterSetList)
{
lineDisplayControl.axOPOSDISP1.CharacterSet = Convert.ToInt32(item);
txtCurrentCharacterSet.Text = "Current CharacterSet is " + item;
for (int i = 0; i < 256; i++)
{
lineDisplayControl.axOPOSDISP1.DisplayTextAt(0, 0, i.ToString() + " " +
((char)i).ToString(), 0);
Thread.Sleep(500);
}
}
var characterSetList = posPrinterControl.axOPOSPrinter1.CharacterSetList.Split(new string[] { "," },
StringSplitOptions.RemoveEmptyEntries);
foreach (string item in characterSetList)
{
posPrinterControl.axOPOSPrinter1.CharacterSet = Convert.ToInt32(item);
MessageBox.Show("Current CharacterSet is " + item);
for (int i = 0; i < 256; i++)
{
posPrinterControl.axOPOSPrinter1.PrintImmediate(2, ((char)i).ToString());
posPrinterControl.axOPOSPrinter1.PrintImmediate(2, " " +
i.ToString() + Environment.NewLine);
}
}
While working on POS.Net, I found that we need to pass "Õ" with characterset
1252 for Toshiba STA10 / STA20 line display device in order to print Euro.
Please take a look at the attached code.