Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft POS C# CharacterSet attribute cannot be set.

I installed Bixolon BCD-1000 OPOS Driver.It can print ASCII characters;however I have to print Cyrillic characters. When I try to change CharacterSet 437(Default Charset) To 999(UNICODE), it returns error message. [Fault Message][1]

        public void DisplayStringOnPort(string line)
    {
        PosExplorer posExplorer = new PosExplorer();
        DeviceInfo receiptPrinterDevice = posExplorer.GetDevices()[0];
        var list = posExplorer.GetDevices();
        foreach(DeviceInfo x in list)
        {
            if(x.ServiceObjectName.Equals("BCD-1000"))
            {
                receiptPrinterDevice = x;

            }
        }
        LineDisplay printer = posExplorer.CreateInstance(receiptPrinterDevice) as LineDisplay;
        printer.Open();
        printer.Claim(1000);
        string str = "Кирилица";
        printer.CharacterSet = 999; // Unicode Fault Message 
        printer.DeviceEnabled = true;
        printer.DisplayTextAt(2, 1, text);
        printer.Close();
    }

How can i overcome this situtation? Thanks

like image 732
Tunahan Yıldırım Avatar asked Oct 30 '22 06:10

Tunahan Yıldırım


1 Answers

The CharacterSet property can only be set to the numeric value of the value contained in the CharacterSetList property.

If the value of the CharacterSetList property does not contain 999, you can not set the CharacterSet property to 999.

Please check the specification of CharacterSetList property of Bixolon BCD-1000 OPOS Driver.

In addition, 999 is the value of ANSI character set. The value of UNICODE is 997.

And perhaps it is better to set the CharacterSet property after setting the DeviceEnabled property to true.

like image 133
kunif Avatar answered Nov 08 '22 07:11

kunif