Re: Printing via webapp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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) {

    global $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...

It's almost certainly permissions-related. The user that your web server runs as needs to have access to the printer.

-Stut

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux