Re: Printing via webapp
| From: | Stut | Date: | Tue, 29 May 2007 21:05:11 +0000 |
| Subject: | Re: Printing via webapp | ||
| References: | 1 2 3 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-27992@lists.php.net to get a copy of this message | ||
Moore, Joshua wrote:
But under printer permissions its set to allow "everyone" to print.I don't know enough about Windows security to be much more help here, but I will say that if you're using IIS then the IUSR_machine user is 'special' and lacks a lot of the permissions that normal users have. Probably worth checking the result of printer_open - I'm guessing it's failing. You may also want to search the archives of this list as problems with printing come up fairly frequently. -Stut
-----Original Message----- From: Stut [mailto:stuttle@gmail.com] Sent: Tuesday, May 29, 2007 1:56 PM To: Moore, Joshua Cc: php-windows@lists.php.net Subject: Re: [PHP-WIN] Printing via webapp Moore, Joshua wrote:Im having a few odd issues with printing and im hoping someone can help me. I can manually print to my barcode printer just fine (FILE<PRINT in a web browser). However if I try and print using PHP printer_write it doesn't print. Yes I have the php_printer.dll installed. My code: <? function getPrinter($SharedPrinterName) {It's almost certainly permissions-related. The user that your web server runs as needs to have access to the printer. -Stutglobal $REMOTE_ADDR;$host = getHostByAddr($REMOTE_ADDR);return "\\\\".$host."\\".$SharedPrinterName;} $handle = printer_open(getPrinter("ZebraZ4M")); printer_write($handle, "Text to print"); printer_close($handle); ?> Gives the following error: Warning: printer_write() [function.printer-write <http://localhost/test/function.printer-write> ]: couldn't allocate the printerjob [1804] in W:\www\test\print.php on line 19 And it doesn't print. I'm quite lost. Also, im using uniform server on windows XP and I do have my printer drivers install since I can print manually just fine...