2016-03-30 125 views
3

我安裝了Bixolon BCD-1000 OPOS Driver.It可以打印ASCII字符,但是我必須打印西里爾文字符。當我嘗試將CharacterSet 437(默認字符集)更改爲999(UNICODE)時,它會返回錯誤消息。 [故障信息] [1]Microsoft POS C#CharacterSet屬性無法設置。

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

我該如何克服這種情況? 謝謝

+0

非常好的問題:P – albatross

回答

0

CharacterSet屬性只能設置爲包含在CharacterSetList屬性中的值的數值。

如果CharacterSetList屬性的值不包含999,你不能將字符集屬性設置爲999

請檢查BIXOLON BCD-1000 OPOS驅動器的CharacterSetList屬性的規範。

另外,999是ANSI字符集的值。 UNICODE的值是997.

也許最好在將DeviceEnabled屬性設置爲true後設置CharacterSet屬性。