Page 1 of 1

working with printer

Posted: Wed Jun 10, 2009 2:02 pm
by Hattori Hanzo
hi
i wanna write a snip code that when someone send a file for printing,it can find out and before printing check its destination printer and then do somethings.
for example, suppose we have 3 printers and when a job is sent to printer1 ,our code detect it and do somethings.

how can i detect print requests?i mean, how can my code detect a job is sent (from other apps)?

Re: working with printer

Posted: Wed Jun 10, 2009 4:27 pm
by requinix
You can't do it with PHP. Not without some extension that I've never heard of before and a lot of patience.

Use another language. A normal language, not something meant for server-side scripting.

Re: working with printer

Posted: Thu Jun 11, 2009 4:21 am
by Hattori Hanzo
:( thanks
and what about JavaScript?

Re: working with printer

Posted: Fri Jun 12, 2009 10:21 am
by socket1
JavaScript is client side so it could only give the client an option to print.

Re: working with printer

Posted: Fri Jun 12, 2009 11:42 am
by mikemike
You'd have to either:
- Use or create a PHP extension that can read from the print spoolers, or
- Use exec(), system(), etc to communicate with the print spoolers and grab the output