mike42 / escpos-php

PHP library for printing to ESC/POS-compatible thermal and impact printers
Other
2.57k stars 862 forks source link

Print from webserver to remote printer. #843

Open ajayshukla opened 4 years ago

ajayshukla commented 4 years ago

I have a website in php and I want to automatically print my orders when they come on my website through API from remote printer. Can anyone guide me how can I do this?

Muraveiko commented 4 years ago

Use cases with paid solutions: QZ Tray https://rawbt.ru/mike42/example_qzio/ JSPM https://rawbt.ru/mike42/example_jspm/

and from me https://rawbt.ru/mike42/example_rawbt/

WilsonicX commented 4 years ago

Could you explain what code to use to work with a bluetooth printer from send to android printer or simply download RawBT ESC/POS? using the code of library por the connection? in this case $connector = new Escpos\PrintConnectors\WindowsPrintConnector("btprinter");

Muraveiko commented 4 years ago

Perhaps I did not understand your question correctly. In the circuits I have described, the print procedure is started by a person in a browser. After clicking the "Paid" button, the bask end sends data to the client’s browser, and they get to the printer through the processing of the server’s response with the functions of the javoscript language. Javoscript sends them to intermediaries. My links show examples of how to convert data from the Mike42 library into a format that is understandable to such programs.

ctf0 commented 4 years ago

@Muraveiko could u plz add a link to the qz example php file, i keep getting JSONObject["data"] is not a JSONArray. on my end, thanx.

mutiemule commented 2 years ago

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, which can receive commands from the online print command and then communicate those commands to the printer through USB.

ourrais commented 1 year ago

@mutiemule hello can you share with us the solution please

EduardVidalTulsa commented 1 year ago

I send orders trough ssh

On Mon, Feb 27, 2023, 16:55 ourrais @.***> wrote:

@mutiemule https://github.com/mutiemule hello can you share with us the solution please

— Reply to this email directly, view it on GitHub https://github.com/mike42/escpos-php/issues/843#issuecomment-1446583036, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECF5AGFWUEHUFGWXZQXQJDWZTE67ANCNFSM4JS5HGAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ourrais commented 1 year ago

@mutiemule can you explain me more and sorry for the inconvenience, please I want examples because I did not understand well

mutiemule commented 1 year ago

ommands to the printer through USB.

@ourrais the node-escpos package on an online server needs a separate implementation on the client to communicate with the printer.

I developed a Service in NodeJS and ElectronJS using node-escpos package as the printer driver.

The service runs on the local machine while the online server hosts mike42/escpos-php. In my case, I implemented this on Laravel which is running on an online server. Then the node js/electron js service is installed on a local machine and mapped to a specific port that listens to commands from the online server for any print command.

ourrais commented 1 year ago

@mutiemule thank you for your answer, can you send me screenshots and thanks in advance

Hussin22 commented 1 year ago

i solve this by make an c# app that recieve printing request