printing over network from PHP app

前端 未结 4 773
广开言路
广开言路 2020-12-08 23:38

I have a set of printers connect over a network with Static IP assigned to each printer.

Now i have a PHP web application running on a linux server which needs to se

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 00:20

    You could use the LPR Printer class from here:

    http://www.phpclasses.org/package/2540-PHP-Abstraction-for-printing-documents.html

    Example:

    setHost("10.0.0.17"); //Put your printer IP here 
    $lpr->setData("C:\\wampp2\\htdocs\\print\\test.txt"); //Path to file, OR string to print. 
    
    $lpr->printJob("someQueue"); //If your printer has a built-in printserver, it might just accept anything as a queue name.
    ?>
    

提交回复
热议问题