#26346 [Com]: Cannot output to a shared printer

From: Date: Fri, 06 Feb 2004 23:29:51 +0000
Subject: #26346 [Com]: Cannot output to a shared printer
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25533@lists.php.net to get a copy of this message
ID: 26346 Comment by: basurto at canada dot com Reported By: rich at dwell dot co dot uk Status: Open Bug Type: PECL related Operating System: Windows 2003 PHP Version: 4.3.4 New Comment: Work around: ------------ I was having the same problem I solve this problem with the following steps: 1. I add Novell client 2. Start nprinter in the machine that have the printer 3. Next I did not add the second parameter It looks like your code>>>printer_start_doc($handle, ""); my code>>>printer_start_doc($handle); 4. voila it works!! NOTE: ----- I already have Novell but if you don't have it you can test this in a share printer with Microsoft. I think there is a problem with the second parameter in a network printer. I hope this help you. Regards Previous Comments: ------------------------------------------------------------------------ [2003-11-21 05:30:21] rich at dwell dot co dot uk Description: ------------ There is a problem with the php_printer.dll. Printing to a local printer is fine although I find that some of the options in printer_set_option do not seem to work. On any share network printer, however, PHP gives warning about not being able to allocate the print job and then terminates. I can in some cases work around this by outputing to a file and then calling the external program print.exe to print the file, but this is only useful for printers with there own proprietory language like label printers. Obviously this is not a rights issue as I am printing to the printer using print.exe which runs under IUSR privileges. Reproduce code: --------------- <?php $handle = printer_open("\\\\Warehouse\\whlaser"); printer_start_doc($handle, ""); printer_start_page($handle); $font = printer_create_font("Arial", 100, 50, PRINTER_FW_MEDIUM, false, false, false, 0); printer_select_font($handle, $font); printer_draw_text($handle, "PHP is simply cool", 400, 400); printer_delete_font($font); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ?> Expected result: ---------------- The network printer should output "PHP is simply cool" as it does on a locally connected printer. Actual result: -------------- Warning: couldn't allocate new print job in c:\inetpub\wwwroot\test\unused routines\print.php on line 4 Warning: couldn't start a new page in c:\inetpub\wwwroot\test\unused routines\print.php on line 5 Warning: couldn't end the page in c:\inetpub\wwwroot\test\unused routines\print.php on line 15 Fatal error: couldn't terminate print job in c:\inetpub\wwwroot\test\unused routines\print.php on line 17 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26346&edit=1

« previous php.pear.dev (#25533) next »