LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-31-2013, 03:38 AM   #1
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Rep: Reputation: 18
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
 
Old 07-31-2013, 09:47 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
You should be able to use the lpr command via the php exec or system functions.
 
Old 08-12-2013, 01:55 AM   #3
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
what if I was in windows I mean if I have to run my web application inside windows ?
 
Old 08-12-2013, 02:02 AM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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.

Last edited by astrogeek; 08-12-2013 at 02:05 AM.
 
Old 08-12-2013, 10:08 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] re. how do I automate printing a print file to a network printer. paul1945 Linux - Newbie 9 08-14-2012 11:37 PM
Ubuntu 11.10 - printer doesen't print, nothing happens when printing firekage Ubuntu 10 03-19-2012 01:42 AM
Application similar to the Vista image print dialogue (multiple images per page) tuxedup Linux - Software 4 09-26-2008 10:06 AM
HP Laserjet 2300 dn printer (Internet Printer) keeps on printing multiple copies mayurmvegad Linux - Networking 0 09-15-2008 02:35 AM
How do I get my Suse 9.1 box to print to the printer attached to my Win XP box? PadreFabuloso Linux - Newbie 2 06-23-2005 04:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration