escpos-php icon indicating copy to clipboard operation
escpos-php copied to clipboard

Printing from web

Open BonfaceMuoki opened this issue 5 years ago • 3 comments
trafficstars

Hi, I am facing a problem printing from my online server.May kindly help me on this?

BonfaceMuoki avatar Aug 26 '20 15:08 BonfaceMuoki

Does your printer is connected to the remote server? I guess that's not how you should make it work. This package should (according to me) connected to the computer where the printers are accessible.

Unless I'm missing something.

Blair2004 avatar Nov 18 '20 17:11 Blair2004

Hi,

I think your question is to print directly from the browser of your system users. If so, today with JS it is not easy to do this.

The solutions that exist, I demanded that you install something, on your client's side so that I can have access to the hardware (printer)

Remember that PHP runs on the server, so it doesn't have access to your client's machine.

I already needed this too 👍

EwertonDutra avatar Nov 20 '20 00:11 EwertonDutra

Printing on local will work well with this package.

However, to print online, you will need to develop a desktop service which has to be installed on the local computer where you need printing to be done. Operating System does not matter in this case, you can be hosting on Linux based server and printing on a windows server. This desktop service interfaces between the online service and the local service.

I resolved this by developing an electron js service based on node-escpos package which can receive commands from the online print command and then communicate those commands to the printer through USB.

You can check out the node-escpos printer driver package for some inspiration on how to go about this.

mutiemule avatar Apr 30 '22 09:04 mutiemule