Пример #1
0
$ipp->setAttribute("cpi", "");
//reset cpi
$ipp->setAttribute("lpi", "");
echo "OPERATION " . $j++ . "<br />";
$ipp->getPrinterAttributes();
printf("Printer state: %s (%s)<br />", $ipp->printer_attributes->printer_state->_value0, $ipp->printer_attributes->printer_state_message->_value0);
// Accepting Jobs (CUPS specfic) //
echo "OPERATION  " . $j++ . "<br />";
echo "Accepting jobs for printer {$printer_uri} (CUPS operation): " . $ipp->cupsAcceptJobs($printer_uri) . "<br />";
/* printing the text file */
echo "OPERATION  " . $j++ . "<br />";
echo "US ASCII file Job status: " . $ipp->printJob() . "<br />";
/* getting only default printer's uri (CUPS extention) */
echo "<br /><br /><br />TEST 29<br />";
echo "OPERATION " . $j++ . "<br />";
printf("Default printer URI [CUPS specific]: %s<pre>\n", $ipp->cupsGetDefaults(array('printer-uri-supported')));
printf("Default printer URI is: %s<br />", $ipp->printer_attributes->printer_uri_supported->_value0);
print_r($ipp->printer_attributes);
echo "</pre>";
/* getting default printer attributes (CUPS extension) */
echo "<br /><br /><br />TEST 30<br />";
echo "OPERATION " . $j++ . "<br />";
echo "Getting default printer attributes [CUPS specific]<br /><pre>\n";
$ipp->setAuthentication($user, $password);
$ipp->cupsGetDefaults(array('all'));
print_r($ipp->printer_attributes);
/* No longer supported?
echo "</pre>\nPrinter historic for default printer:\n"; 
    
$histo = $ipp->printer_attributes->printer_state_history->_value1;