예제 #1
0
echo "OPERATION " . $j++ . "<br />";
echo "Sending document: " . $ipp->sendDocument($job) . "<br />\n";
echo "OPERATION " . $j++ . "<br />";
echo "Sending URI: " . $ipp->sendURI('http://localhost', $job) . "<br />\n";
$ipp->setDocumentName("text string");
$ipp->setData("This is the string of second document");
echo "OPERATION " . $j++ . "<br />";
echo "Sending text string as _last_ document: " . $ipp->sendDocument($job, $last = true) . "<br />\n";
// must be refused. Hem: CUPS is very smart, it accepts :)
echo "OPERATION " . $j++ . "<br />";
echo "Sending document (must be refused): " . $ipp->sendDocument($job, $last = true) . "<br />\n";
/* try to validate a job with filetype printer server can't handle */
echo "<br /><br /><br /> TEST 19<br />";
$ipp->setMimeMediaType("application/x-foobar");
echo "OPERATION " . $j++ . "<br />";
echo "Validate-Job for a document with file format 'application/x-foobar': " . $ipp->validateJob() . "<br />";
$ipp->setMimeMediaType();
echo "\n<br />MEDIATYPE ", $ipp->meta->mime_media_type, "<br />\n";
foreach ($ipp->attributes as $name => $attribute) {
    if ($attribute->_range == 'unsupported-attributes') {
        printf('%s "%s": unsupported attribute<br />', $name, $attribute->_value0);
    }
}
reset($ipp->attributes);
echo "Details:<pre>";
print_r($ipp->attributes);
echo "</pre>";
/* Printing then holding a job */
echo "<br /><br /><br /> TEST 20<br />";
echo "OPERATION " . $j++ . "<br />";
echo "Printing a document :" . $ipp->printJob() . "<br />";