Exemplo n.º 1
0
echo "OPERATION " . $j++ . "<br />";
$ipp->setAttribute('number-up', 2);
$ipp->setSides(2);
echo "Setting printer's attributes for {$printer_uri}:" . $ipp->setPrinterAttributes('text/plain') . "<br />";
echo "<pre>\n";
print_r($ipp->attributes);
echo "</pre>\n";
echo "OPERATION " . $j++ . "<br />";
echo "Getting printer's attributes: " . $ipp->getPrinterAttributes() . "<br />";
echo "<pre>\n";
print_r($ipp->attributes);
echo "</pre>\n";
/* rejecting jobs (CUPS specific)*/
echo "<br /><br /><br />TEST 28<br />";
echo "OPERATION  " . $j++ . "<br />";
echo "Rejecting jobs for printer {$printer_uri} (CUPS operation): " . $ipp->cupsRejectJobs($printer_uri, $printer_state_message = "Printer stopped for maintainance") . "<br />";
// try to print //
echo "OPERATION " . $j++ . "<br />";
$ipp->setCharset('us-ascii');
$ipp->setMimeMediaType('text/plain');
$ipp->setJobName("PHP Test: US ASCII file", true);
// default is false: number is automagically appended
//$ipp->setAttribute("job-sheets", array("confidential","secret"));
$ipp->setAttribute("cpi", 17);
// 10,12 or 17. default to 10 //cpi and lpi attributes are CUPS specific
$ipp->setAttribute("lpi", 8);
// 6 or 8, default: 6
$ipp->setData("./test.txt");
//Path to file.
echo "US ASCII file Job status: " . $ipp->printJob() . "<br />";
$ipp->setAttribute("cpi", "");