watsmyname Posted September 20, 2010 Share Posted September 20, 2010 Hello, Greetings! I have php application for restaurant, basically there are two types of orders Kitchen Items and Bar items. A cashier enters a order from customers from computer A (say). We have two computers in kitchen, Computer B and in Bar, Computer C. When cashier from computer A clicks a button, depending upon the order type i need to print a chit on Computer B and/or Computer C. COmputer A, B, C are in same network. All computers have laser printer which can print any type of content. Well i tried to search the forum, i couldn't find anything that would be of my help. Can anyone tell me what would be the starting point for this?? Thanks watsmyname Quote Link to comment https://forums.phpfreaks.com/topic/213904-printing-simultaneously-on-two-network-printers/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 20, 2010 Share Posted September 20, 2010 Php itself has very limited direct ability to print (Under Windows there is a 'print' extension, though it is currently not available.) You would probably need to use shell_exec() to either send commands to your operating system's 'print' command or to an application that accepts command line arguments to print a supplied document. Quote Link to comment https://forums.phpfreaks.com/topic/213904-printing-simultaneously-on-two-network-printers/#findComment-1113305 Share on other sites More sharing options...
watsmyname Posted September 20, 2010 Author Share Posted September 20, 2010 Thanks for the reply. I don't know how to use shell_exec command to get job done. I tried to google but didnt get any useful results. Moreover, all computers have windows environment and PHP pages are located locally (i.e. for example http://192.168.0.23/restaurant/index.php=> Computer A). Quote Link to comment https://forums.phpfreaks.com/topic/213904-printing-simultaneously-on-two-network-printers/#findComment-1113325 Share on other sites More sharing options...
PFMaBiSmAd Posted September 20, 2010 Share Posted September 20, 2010 The following example creates a .pdf document and prints it - <?php require('./fpdf.php'); // the fpdf library (w/font folder) $pdf=new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output('c:\test.pdf'); // both of the following strings work $cmd = '"C:/Program Files/Adobe/Reader 9.0/Reader/AcroRd32.exe" /t c:/test.pdf'; // the double-quotes around the command portion are required $cmd = "\"C:/Program Files/Adobe/Reader 9.0/Reader/AcroRd32.exe\" /t c:/test.pdf"; // the double-quotes around the command portion are required shell_exec($cmd); ?> Quote Link to comment https://forums.phpfreaks.com/topic/213904-printing-simultaneously-on-two-network-printers/#findComment-1113336 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.