From: "Peter Below (TeamB)" <100113.1101@compuXXserve.com> Subject: Re: sending a chatracter to a Epson printer to Open Cash Drawer Date: 2000/08/01 Message-ID: #1/1 Content-Transfer-Encoding: 8bit References: <8m6u6a$i9b7@bornews.borland.com> Content-Type: text/plain; charset=iso-8859-1 X-Trace: 1 Aug 2000 13:52:55 -0800, 62.156.31.63 Organization: TeamB Mime-Version: 1.0 Reply-To: 100113.1101@compuXXserve.com Newsgroups: borland.public.delphi.basm In article <8m6u6a$i9b7@bornews.borland.com>, Samuel Lebowitz wrote: > I have to send Char(129) to a Epson TM-88 it should open the cash drawer > how do I send it? The technique is shown here for the generic/text only printer driver. If you have installed a printer icon for the Epson simply use the name of the printer as it appear inside the printer applet. You can use this procedure to send any kind of data to the printer directly, bypassing the driver. To send a #129 you would simply use PrintLineToGeneric( #129 ); Print a line to the generic/text printer without formfeed Uses WinSpool; Const GenericPrinter: Pchar = 'Universal/Nur Text'; // Change to systems generic drivers 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) 100113.1101@compuserve.com) No e-mail responses, please, unless explicitly requested!