954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

send ascii contorl characters

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 is the ascii stx character (HEX 0x02) is the ascii line termination character (HEX 0x0D)

LKc
1234512345example
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

mbates
Newbie Poster
1 post since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

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);
petr.pavel
Junior Poster
117 posts since Mar 2008
Reputation Points: 30
Solved Threads: 16
 

You may need to specify the server name before the printer name.

printer_open('\\SERVERNAME\PRINTERNAME');


More information on the printer functions can be found here: http://php.mirrors.ilisys.com.au/manual/en/function.printer-open.php

phper
Posting Whiz in Training
213 posts since Nov 2006
Reputation Points: 22
Solved Threads: 19
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You