POS for .Net print formatting - can't use escape character (char)27

后端 未结 7 2170
不思量自难忘°
不思量自难忘° 2021-01-26 04:03

I figured out how to print basic text to our POS printer, but I can\'t figure out how to get the escape characters to work (for bold, text alignment, etc). For now I\'m just tes

7条回答
  •  渐次进展
    2021-01-26 04:12

    Androidz answer is correct. Also you can do some thing like below.

    Assume you want to print bold.

    string text = "ESC|bC" + "BOLD Text";
    // Now replace ESC as below.
    string textToPrint = text.Replace("ESC", ((char)27).ToString());
    

    That's it.

提交回复
热议问题