Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Printing/Displaying different characters on POS LineDisplay(Customer Display) or POS Printer

0.00/5 (No votes)
22 Jan 2016 1  
How to print/display different characters on POS LineDisplay (Customer Display) or POS Printer

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

  1. Knowledge of POS for .NET and how to configure POS Device
  2. 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.

// Character Identification from Line Display

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);
    }
}

// Character Identification from POS Printer
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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here