How to send page cut command to Epson printer

后端 未结 3 685
清酒与你
清酒与你 2020-12-30 08:47

I\'m trying to cut the paper pragmatically by sending paper cut command to the printer (Epson TM U220 with USB port). I used the printer with Generic/Text Only Driver and Ep

相关标签:
3条回答
  • 2020-12-30 09:12

    Thank you very much Hans. Now I can send Paper cut command by using Microsoft RawPrinterHelper class. I've been seeking this solution for six days. Here is what I've done.

    string GS = Convert.ToString((char)29);
    string ESC = Convert.ToString((char)27);
    
    string COMMAND = "";
    COMMAND = ESC + "@";
    COMMAND += GS + "V" + (char)1;
    
    PrintDialog pd = new PrintDialog();
    pd.PrinterSettings = new PrinterSettings();
    if (DialogResult.OK == pd.ShowDialog(this))
    {
    RawPrinterHelper.SendStringToPrinter(pd.PrinterSettings.PrinterName,  COMMAND);
    }
    
    0 讨论(0)
  • 2020-12-30 09:16

    For those printing with netcat (really easy way to print something without installing any driver), to cut the paper:

    echo -e "\x1B@\x1DV1" | nc printer.ip 9100
    

    Same string like in the c# version, but mapped to hex: \x1B = ESC and \x1D = GS.

    0 讨论(0)
  • 2020-12-30 09:39
    s = Replace(s, "<KESME>", Chr(27) + Chr(105), 1) ' Termal Printer
    
    
    Chr() +chr() 
    
    0 讨论(0)
提交回复
热议问题