working with printer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Hattori Hanzo
Forum Newbie
Posts: 2
Joined: Wed Jun 10, 2009 1:52 pm

working with printer

Post 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)?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: working with printer

Post 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.
Hattori Hanzo
Forum Newbie
Posts: 2
Joined: Wed Jun 10, 2009 1:52 pm

Re: working with printer

Post by Hattori Hanzo »

:( thanks
and what about JavaScript?
socket1
Forum Commoner
Posts: 82
Joined: Mon Dec 08, 2008 7:40 pm
Location: Shokan, New York

Re: working with printer

Post by socket1 »

JavaScript is client side so it could only give the client an option to print.
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: working with printer

Post 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
Post Reply