Exemplo n.º 1
0
$ipp->setCharset('us-ascii');
$ipp->setMimeMediaType('text/plain');
$ipp->setJobName("PHP Test: US ASCII file", true);
// default is false: number is automagically appended
$ipp->setData("./test.txt");
//Path to file.
$ipp->setAttribute("job-sheets", array("confidential"));
echo "US ASCII file Job status: " . $ipp->printJob() . "<br />";
$ipp->setAttribute("job-sheets", "");
$ipp->setAttribute("cpi", "");
//reset cpi
$ipp->setAttribute("lpi", "");
/* printing a document by URI */
echo "<br /><br /><br /> TEST 5<br />";
echo "OPERATION " . $j++ . "<br />";
echo "Job Print URI status: " . $ipp->printUri($document_uri) . "<br />";
/* printing a text file in utf-8 */
/*
echo "<br /><br /><br /> TEST 6<br />";
echo "OPERATION ". $j ++ ."<br />";
$ipp->setUserName("foo bar");
$ipp->setCharset('utf-8');
$ipp->setMimeMediaType('text/plain'); // if autodetection do not work
// attributes without dedicated function
$ipp->setAttribute('orientation-requested','landscape');
$ipp->setAttribute('number-up',2);
$ipp->setDocumentName("testfile with UTF-8 characters, gzipped");
$ipp->setJobName("testfile with UTF-8 characters, gzipped");
$ipp->setDocumentName("testfile with UTF-8 characters");
$ipp->setData("./test-utf8.txt");//Path to file
echo "Printing testfile with UTF-8 characters: ".$ipp->printJob()."<br />";