Groups | Blog | Home
all groups > dotnet windows forms > may 2006 >

dotnet windows forms : ESC/POS commands for printer.


Radhakrishna Banavalikar
5/13/2006 11:53:01 PM
Can some angel tell me how to send HEX commands using the Whidbey Serial port
component [language C#]? I want to drive a printer that accepts commands like
"GS V", "LF", "ESC * ...." etc.

Thanks in advance.
--
Radhakrishna Banavalikar
Dmytro Lapshyn [MVP]
5/15/2006 1:32:16 PM
Hi,

I am not sure what do you mean here... if you speak of an old printer (or a
printer that supports so-called escape codes out of backwards
compatibility), you should just know the hexadecimal values of these codes.

For example, CR and LF are 0x0d and 0x0a, ESC is 0x1b

Google for the rest, keeping in mind that different printers have different
"escape sequences", and only a small subset of them is common (AFAIR).

Then, you just send these bytes to the printer's port.

However, printers are usually connected to parallel (LPT) ports and not
serial ports. Not sure if the Whidbey Serial port component you're talking
about is capable of sending data to an LPT port.

"Radhakrishna Banavalikar"
[quoted text, click to view]
Dmytro Lapshyn [MVP]
5/15/2006 6:41:30 PM
And this is a fresh MS KB article on sending raw data to a printer:

http://support.microsoft.com/kb/322091/en-us

"Radhakrishna Banavalikar"
[quoted text, click to view]
AddThis Social Bookmark Button