我在使用C#.net
向我的Epson tm-t70打印机发送print logo命令时遇到问题我在网上搜索过,我想出了很多神秘的东西。最有用的是我需要发送以下命令:
[Name] Print the specified NV graphics data.
[Format] ASCII GS ( L pL pH m fn kc1 kc2 x y
Hex 1D 28 4C 06 00 30 45 kc1 kc2 x y
Decimal 29 40 76 6 0 48 69 kc1 kc2 x y
[Range] (pL + pH × 256) = 6 (pL = 6, pH = 0)
m = 48
fn = 69
32 ≤ kc1 ≤ 126
32 ≤ kc2 ≤ 126
我不知道如何在C#中启动此命令,文档没有多大帮助。
答案 0 :(得分:1)
以下代码解决了这个问题。想知道感谢@stukelly
string GS = Convert.ToString((char)29);
string ESC = Convert.ToString((char)27);
//Assemble the paper cut command
string COMMAND = "";
COMMAND = ESC + "@";
COMMAND += GS + "V" + (char)1;
//Assemble the print logo command
String printCommand = ESC + "@";
printCommand += GS;
printCommand += Convert.ToString((char)40);
printCommand += Convert.ToString((char)76);
printCommand += Convert.ToString((char)6);
printCommand += Convert.ToString((char)0);
printCommand += Convert.ToString((char)48);
printCommand += Convert.ToString((char)69);
printCommand += Convert.ToString((char)48);
printCommand += Convert.ToString((char)48);
//printCommand += (48).ToString();
//printCommand += (48).ToString();
printCommand += ((char)(1)).ToString();
printCommand += ((char)(1)).ToString();
//END OF PRINT COMMAND