Forum Moderators: coopster

Message Too Old, No Replies

Hoan PHP (or other web code) automatically communicate with a printer?

How can I get a website to print orders via email automatically?

         

php_dave

11:03 am on Jun 27, 2011 (gmt 0)

10+ Year Member



Hello. If this is in the wrong section then I apologise but I'm not sure where it would go.

Basically I am building a website for a client who owns a takeaway. He wants the orders to automatically get printed via a thermal receipt printer plugged into his laptop.

Obviously I can code the site to receive orders and email him with them but I don't know what I have to do to make the site tell the computer to automatically print an email / webpage.

Does anyone know the simplest way to do this?

Thanks.

penders

11:50 am on Jun 27, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just a thought... you could use AJAX to poll the server and check for new orders. Display the new order on the webpage and issue a window.print(). However, you will still have to respond to the windows print dialog.

I did come across a browser extension (Firefox) ages ago that allowed you to control many printing features through JavaScript, although I couldn't get it to work at the time. This might allow you to bypass the windows print dialog.

lostdreamer

9:37 am on Jul 4, 2011 (gmt 0)

10+ Year Member



Dont use one tool for everything ;)

Make the website send all orders to his email (separate mailbox).
Then install outlook (or other email client) on the laptop and set that up to auto-print every email:
[email.about.com...]


Regards,
LostDreamer