I am trying to set up a web based POS system and have got everything working apart from printing directly to a barcode / label printer.

When printing to the barode printer I need to send it a text stream of ascii characters with none printable control characters. Here's an example <STX> is the ascii stx character (HEX 0x02) <CR> is the ascii line termination character (HEX 0x0D)


Does anyone know how I could generate this stream and send it to the printer (or windows print spool)?

Thanks for any help.

Hi there, I have no experience with printing directly from PHP but here's what I found in PHP manual. I hope it helps.

$handle=printer_open("EPSON TM-T88III Receipt");
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_write($handle, $yourRawData);