views:

695

answers:

4

Hi all, i am workng on a project that will end up printing recpts, my client uses a dot-matrix printer (some old version). He will need a system where rcpt 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 thought of solutions.

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

-the problem is that am gtng a hard time getting server side printers from php. Logically it seems to work.

Platform =====> WIN XP

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

Thats all.thnx to ol who read and respond.

yours: the_forgotten_GURU

+2  A: 

What's the intended workflow before the user hit's enter?
What's the make and model of printer? This is important so that we can see if it needs any fancy escape codes sent to it?
Usually if you're printing then it would be sent from the client machine.
If printing from the server the data needs to be either sent to the server or needs to already be there and accessible. Is it already there in a database? Or are you sending a webform?
You say RCPT, is this a receipt?

Trevr
Good and fair questions.
Pekka
A: 

What's the intended workflow before the user hit's enter?

  • It is a normal web form, wth details like rcpt (receipt) number, amount paid, balance and all those stuff

What's the make and model of printer? This is important so that we can see if it needs any fancy escape codes sent to it?

  • Its an EPSON LQ-300+ model P172A

Usually if you're printing then it would be sent from the client machine. If printing from the server the data needs to be either sent to the server or needs to already be there and accessible. Is it already there in a database? Or are you sending a webform?

  • sending a webform with url variables.

You say RCPT, is this a receipt?

  • yup, it is receipt
the_forgotten_guru
Please respond to answers by adding comments or editing your question.
therefromhere
+1  A: 

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');
Trevr
A: 

http://www.phpbuilder.com/board/archive/index.php/t-10100599.html

i think there is some insight thr!

the_forgotten_guru