Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send escape sequence to receipt printer

Status
Not open for further replies.

gillesnebel

Programmer
Mar 22, 2005
13
0
0
CH
Hi,

I'm building a small POS-Application that prints receipts to EPSON TM-88iii. To print these receipts I actually send raw data to the printer using Visual Basic .NET C#(Microsoft Q322090).
See:
My problem is, that I want to insert Paper Cut in C# and that I don't know how to send the EPSON escape sequences ESC/POS to the printer.. I tried to insert different pieces of code into my string, but it doesn't work.

Can somebody help me please

Thanks very much
 
Put those bytes into a byte array, then pass them to the GetString method of the ASCIIEncoding class.

This ought to work, as the ASCIIEncoding class will translate values from U+0000 to U+007F

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Hi chiph,

Thanks for your answer. I tried to add the mentionend ASCIIEncoding Class but I couldn't make it work :-(

Can you give me a code example basing on Microsoft Thread?

Thanks very much

Gilles
 
Try something like this
Code:
byte[] b = new byte[] { 0x1B, 0x50, 0x4F, 0x46 };

ASCIIEncoding ascii = new ASCIIEncoding();
String encoded = ascii.GetString(b);

Console.WriteLine(encoded);
This chart might be helpful:


Chip H.

____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top