Пример #1
0
// Set printer URI here
//$ipp->setPrinterURI("ipp://localhost:631/printers/epson"); // Set printer URI here
//$ipp->setPrinterURI("/printers/foo"); // => abort "client-error-not-found"
$ipp->setUserName("php IPP tester");
$ipp->setFidelity();
// printing abort if every attribute could not be set on printer. NOTE: CUPS do not abort :)
$ipp->setCharset('utf-8');
$ipp->setLanguage($language);
$ipp->setAuthentication($user, $password);
// username & password
$j = 0;
$test = 1;
/* printing a large file */
echo "<br /><br /><br />TEST 1<br />";
echo "OPERATION  " . $j++ . "<br />";
$ipp->setAttribute("printer-resolution", "1440x720dpi");
$ipp->setAttribute("job-billing", "Thomas");
$ipp->setAttribute("print-quality", "high");
$ipp->setAttribute("scaling", 100);
//$ipp->setCopies(2);
$ipp->setData('./photo.jpg');
$ipp->setJobName('photo.jpg', true);
echo "Printing a large file: " . $ipp->PrintJob() . "<br />";
printf('$ipp->status[0] = %s <br /><br />', $ipp->status[0]);
$ipp->unsetAttribute("job-billing");
$ipp->setJobName();
$ipp->setAttribute("scaling", "");
/* getting printer's attributes */
echo "<br /><br /><br />TEST 2<br />";
echo "OPERATION  " . $j++ . "<br />";
echo "Getting Printer's attributes: " . $ipp->getPrinterAttributes() . "<br />";