本文介紹了從 PHP 應用程序通過網絡打印的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我有一組打印機通過網絡連接,并為每臺打印機分配了靜態 IP.
I have a set of printers connect over a network with Static IP assigned to each printer.
現在我在 Linux 服務器上運行了一個 PHP Web 應用程序,它需要通過網絡將打印作業發送到這些打印機.
Now i have a PHP web application running on a linux server which needs to send print jobs, to these printer over the network.
這是否可以使用 lpr 或 cups 以及我該如何處理.
Is this possible using lpr or cups and how do i go about it.
推薦答案
您可以從這里使用 LPR 打印機類:
You could use the LPR Printer class from here:
http://www.phpclasses.org/package/2540-PHP-Abtraction-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.
?>
這篇關于從 PHP 應用程序通過網絡打印的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!