我有一组打印机通过网络连接到分配给每台打印机的静态IP.
现在我有一个运行在linux服务器上的PHP Web应用程序,需要通过网络将打印作业发送到这些打印机.
这可能是使用lpr还是杯子,我该怎么办?
您可以从这里使用LPR Printer类:
http://www.phpclasses.org/package/2540-PHP-Abstraction-for-printing-documents.html
例:
<?PHP include("PrintSend.PHP"); include("PrintSendLPR.PHP"); $lpr = new PrintSendLPR(); $lpr->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. ?>