Can anybody send me a little procedure that sends the following escape
characters to an EPSON printer that is connected to a cash drawer:
ASCII : ESC p m t1 t2
Decimal: 27 112 0 20 80
m = 0 for the 1st drawer
m = 1 for the 2nd drawer
Thanks in advance
Best:
Al
Lefteris Georgiou <lefteris...@skynet.be> wrote in message
news:8nbcb0$sr...@bornews.borland.com...
Paul :)
"Aleko Boychev" <al...@numberonemm.com> wrote in message
news:399937ad_2@dnews...
PrintLineToGeneric( #27#112#0#20#80 );
where
Uses WinSpool;
Const
GenericPrinter: Pchar = 'Universal/Nur Text';
// Change to systems generic drivers name or Epson printer name
Procedure PrintLineToGeneric(Const line: string );
Var
BytesWritten: DWORD;
hPrinter: THandle;
DocInfo: TDocInfo1;
Begin
If not WinSpool.OpenPrinter(GenericPrinter, hPrinter, nil) Then
raise exception.create('Printer not found');
Try
DocInfo.pDocName := 'MyDocument';
DocInfo.pOutputFile := Nil;
DocInfo.pDatatype := 'RAW';
If StartDocPrinter(hPrinter, 1, @DocInfo) = 0 Then
Abort;
Try
If not StartPagePrinter(hPrinter) Then
Abort;
try
If not WritePrinter(hPrinter, @line[1], Length(line), BytesWritten)
Then
Abort;
Finally
EndPagePrinter(hPrinter);
End;
Finally
EndDocPrinter(hPrinter);
End;
Finally
WinSpool.ClosePrinter(hPrinter);
End;
End;
Peter Below (TeamB) 10011...@compuserve.com)
No replies in private e-mail, please, unless explicitly requested!