title: access clients printer on local network from a local server
body: <p>I am testing a website by connecting 2 computers via router and Ethernet cables where one of the PCs has the website with WAMP and is acting as a server.  </p>
  
  <p>Everything is fine and working but there is one problem. I have written PHP to print the final receipt via a thermal printer which works perfectly when printing on the server computer where that thermal printer is connected via USB.<br>
  Now the problem is when the second computer working as a client accesses the website how will it print the receipt through a thermal printer connected to it via USB? The server won't find the printer connected to the client. </p>
  
  <p>Of course I thought JavaScript is the best way to do it if I want to access the client's printer but that has a one big flaw.<br>
  When I load the printable content in a new window using <code>window.open()</code> and then write data to it. I then call <code>window. print();</code> and it does print the content but it doesn't stop. After printing the data on the receipt it keeps on pushing empty receipts out the printer and never stops.  </p>
  
  <p>PHP works fine, it just prints the data and then stops so that I can tear the receipt. Why won't the printer stop after printing the data when using JavaScript. </p>
  
  <p>Please help. It's the only thing left.. </p>