CupsPrintIPP is an extension of class library of PrintIPP. It implements operations which are not part of Internet Printing Protocol as described by RFCs.
It is built on CUPS-IPP-1.1 document.
echo "Printer attributes for printer $i:<pre>\n"; print_r($ipp->printer_attributes); echo "</pre>";
if (isset($ipp->printer_attributes->printer_type->_value2)
&& ($ipp->printer_attributes->printer_type->_value2) == 'print-black')
echo "The printer can print black<br />\n";
if (isset($ipp->printer_attributes->printer_type->_value3)
&& ($ipp->printer_attributes->printer_type->_value3) == 'print-color')
echo "The printer can print color<br />\n";
$ipp->cupsGetDefaults(array('all'));
echo "</pre>\nPrinter historic for default printer:\n";
$histo = $ipp->printer_attributes->printer_state_history->_value1;
$idx_histo = "_indice0";
for ($idx = 0 ; isset($histo->$idx_histo) ; $idx ++) {
echo "<h3>next event:</h3>\n";
foreach ($histo->$idx_histo as $key => $value) {
if (is_object($value))
if ($key != 'printer_state_time')
printf("%s: %s<br />",$key,$value->_value0);
else
printf("%s: %s<br />",$key,date('Y-m-d H:i:s',$value->_value0));
$idx_key = "_key". ($key + 1);
}
$idx_histo = '_indice'. ($idx + 1);
}