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

Windows printconnector error on the server

Open Seykaya opened this issue 3 years ago • 1 comments

In my application, it works local, but it drops an error like this on the server, what can I do for it

Printer 'smb:$computer_name$printer_name' is not a valid printer name. Use local port (LPT1, COM1, etc) or smb://computer/printer notation.

Please Help Meee

Seykaya avatar Jan 20 '21 12:01 Seykaya

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. This is because PHP is a server-side scripting language, so once you put this online, it won't be able to communicate to the local printer. Thus, you need a client service running on the local machine and this is where electron js and node js come into play.

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.

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.

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