Hi

I'm not sure if this is a documentation error or a bug in php_printer.dll
but here goes...

printer_open() is returning NULL upon failure, not FALSE i.e. the following
code doesn't work:

<?php
$printer = "\\\\greg-mac\\LaserJet_5";
if(($conn_printer = printer_open($printer)) === FALSE)
        die("Could not connect to $printer\r\n");
var_dump($conn_printer);
printer_close($conn_printer);
?>

This does:

<?php
$printer = "\\\\greg-mac\\LaserJet_5";
if(($conn_printer = printer_open($printer)) === NULL)
        die("Could not connect to $printer\r\n");
var_dump($conn_printer);
printer_close($conn_printer);
?>

Version info:

PHP 4.3.10 (cli) (built: Dec 14 2004 17:48:04)
php_printer.dll         29-Mar-2005 16:28    40k


Best regards,
Greg Jackson
Web Administrator

Active Components (NZ) Ltd
PO Box 100-544, Auckland
New Zealand

DDI: +64-9-443 9519
Sales: +64-9-443 9500
Fax: +64-9-443 9502
http://www.activecomponents.com/

Reply via email to