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)

<STX>L<CR>
<STX>Kc<CR>
1234512345example<CR>
E

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

Thanks for any help.
Mike

Recommended Answers

All 2 Replies

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);
printer_close($handle);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.