I need to make a print on cups printer from my PHP web application. Is there a PHP API for cups? In my server shell_exec() and all such functions are strictly disabled. So I cant print using lpr. Please advice

有帮助吗?

解决方案

Now it's available. We can do it by PHP::PRINT::IPP
Sample Code

<?php require_once(PrintIPP.php); $ipp = new PrintIPP(); $ipp->setHost("localhost"); $ipp->setPrinterURI("/printers/epson"); $ipp->setData("./testfiles/test-utf8.txt"); // Path to file. $ipp->printJob(); ?>

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top