capture printer port in php

P

Thread Starter

prashant

i need to capture printer port (Lpt, dot matrix) for an intranet application written in php, mysql. so as to increase the printer speed. i need to capture printer port, like we do in dos.....

please help..its urgent
 
C

Curt Wuollet

I'm not a php expert, but can you write to /dev/lp(x)? That is about as low level as you would want to go. Kill the print services and try that.

Regards
cww
 
C

Curt Wuollet

Well, if you are running Linux or another *nix, everything is a file
so you can write your output directly to /dev/lp. There is still a driver in between but it will not delay or block unless the printer is offline. It will handshake on buffer full.

You would probably want to kill the lpr or cups daemon to avoid mixing output if someone touches off an unrelated print job. And you
would have to handle formatting, etc. But you wanted to know how to get around the spooler.

If you want to know whats going to happen you can peruse the lp driver source. You can even install your own lp driver. Or use a named pipe with whatever name your php script wants to write to. If you are running php on a Windows host, I have no idea how to eliminate delays as I don't think recent versions let you write directly to the driver or port. About all you can do is throw your data into the (secret) cloud and see what it does. I'm sure if I'm wrong the Windows guys will correct me :^) I don't code on Windows.

Regards
cww
 
Top