LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP: printing to multiple printer without print dialogue box of browser (https://www.linuxquestions.org/questions/programming-9/php-printing-to-multiple-printer-without-print-dialogue-box-of-browser-4175471566/)

golden_boy615 07-31-2013 03:38 AM

PHP: printing to multiple printer without print dialogue box of browser
 
I would like to know is there a possible way in PHP programming to write a web application to automatically send printing request to an individual printer in multiple printers on the network without the use of print dialogue box of browser.
I have 3 different printer in my network and I want to have three buttons in my interface which is pushing each one is equal to sending my printing job to one of them.
(button1 -> printer1)
(button2 -> printer2)
(button3 -> printer3)
thanks for any help

michaelk 07-31-2013 09:47 AM

You should be able to use the lpr command via the php exec or system functions.

golden_boy615 08-12-2013 01:55 AM

what if I was in windows I mean if I have to run my web application inside windows ?

astrogeek 08-12-2013 02:02 AM

I don't think you can do that - from the http request I am pretty sure that all you can do is trigger the browser's print dialog, you cannot tell it anything about a specific printer because neither the server side (i.e., php) nor client side (i.e., browser) have any knowledge of available print hardware - that is what the dialog does.

There is nothing GNU/Linux or other OS specific about this mechanism.

michaelk 08-12-2013 10:08 AM

The windows print command can only print text files so using the PHP shell_exec is probably not an option if the printer is attached to the windows box. It might be possible to print other files via an application but it isn't something I have investigated. It should be possible to print via lpr if the printer is networked via a linux box.

Sure, on a linux box I can write a CGI program that will print to a specific printer when a button is pushed on a web page. Which I believe is the question the OP is asking.


All times are GMT -5. The time now is 05:09 PM.