Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP to print using dot-matrix printers

I am working on a project that will end up printing receipts, my client uses a dot-matrix printer (some old version). He will need a system where receipt printing will be fast i.e. time efficient, and not opening a dialog box and choosing a printer...moreover the printer will be shared through a network.

The main problem is that all this should be done using PHP. the following are some thoughts of solutions.

  • Design a php script to write data to a text file then print the text file using a remote printer

-the problem is that I am having a hard time getting server side printing from PHP. Logically it seems to work.

Platform =====> WIN XP

Printer Location =====> Main server on a LAN N/W

like image 209
the_forgotten_guru Avatar asked Jul 30 '26 07:07

the_forgotten_guru


1 Answers

Okay, so if you have the text file created on the server you should be able to copy the text file to lpt1: or 2: or whatever device it's defined as. You need to know what the file's named as, or you could pass it on, but how about:

exec('c:\WINDOWS\system32\cmd.exe /c START C:\some_dir\print_me.bat');
like image 198
Trevr Avatar answered Jul 31 '26 22:07

Trevr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!