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!

Epson commands

Status
Not open for further replies.

dufduf

Programmer
Nov 11, 2009
3
0
0
PL
What is the right code that prints text at a specific position. There are the Epson commands in the section on horizontal position three instructions: Print Position, Execute current print position from left margin and Set print position. I can not deal with sending commands and I do it this way:

LPBYTE cSendBuf = NULL;
int textSize = 9;
cSendBuf = (LPBYTE) malloc ( textSize*sizeof(BYTE) );
cSendBuf[0] = 0x18; //clear print buffer

cSendBuf[1] = 0x1B; // Set left margin
cSendBuf[2] = 0x6C;
cSendBuf[3] = 0x1;

cSendBuf[4] = 0x1B; // Print position, it doesn`t work
cSendBuf[5] = 0x5C;
cSendBuf[6] = 0x40;
cSendBuf[7] = 0x14;

cSendBuf[8] = 'T';

if( !RawDataToPrinter( L"\\\\AGO\\Oki ML 520 Elite (IBM)", cSendBuf, textSize ) ) ShowMessage("Error");

free(cSendBuf);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top