Jump to content

Printing Simultaneously on two network printers


watsmyname

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.