I can print directly from the server, but from the script page I get "Warning: couldn't allocate the printerjob in <code line whatever>. I'm using php version 4.06 on Win2000 Advanced Server. Code sample...
<?
$DATA = array("Test Header", "Test Page");
//dump list of local printers know to machine
$PRINTERS = printer_list(PRINTER_ENUM_LOCAL);
foreach($PRINTERS as $key=>$val) {
foreach($val as $sub_key=>$value) {
echo $sub_key.": ".$value."<br>";
}
}
?>
<p>
<?
// do the actual printing work
$printer = "\<net node>\<printer>";
echo "printer: ".$printer."<br>";
$handle = printer_open($printer);
foreach($DATA as $val) {
printer_write($handle, $val);
echo $val."<br>";
}
printer_close($handle);
?>