printing - php LPR Printer class -
how use lpr printer class print txt
file usb printer epson lq-1150?
<?php include("printsend.php"); include("printsendlpr.php"); $lpr = new printsendlpr(); $lpr->set-host("192.168.1.152"); //put printer ip here $lpr->setdata("c:\\wampp2\\htdocs\\print\\test.txt"); //path file, or string print. $lpr->printjob("somequeue"); //if printer has built-in printserver, might accept queue name. ?>
in set host want use share printer name or host?
this command using printing ip printers:
you need install lpr service windows , linux on server.
if ($this->agent->platform() == 'linux') { $command = 'lpr -s ' . $printer->printer_ip . ' -p ' . $printer->printer_name . ' -o -x ' . $file; //$command = 'lp -d ' . $printer->printer_name . ' ' . $file; if (exec($command)) { return true; } else { return false; } } if ($this->agent->platform() == 'windows xp') { $command = 'lpr -s ' . $printer->printer_ip . ' -p ' . $printer->printer_name . ' -o -x ' . $file; if (exec($command)) { return true; } else { return false; } } if ($this->agent->platform() == 'unknown windows os') { $command = 'lpr -s ' . $printer->printer_ip . ' -p ' . $printer->printer_name . ' -o -x -d ' . $file; if (exec($command)) { return true; } else { return false; } }
Comments
Post a Comment