[SOLVED] getting the list of printers
Moderator: General Moderators
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
getting the list of printers
how can i getthe list of printers on the server?
i it possible?
thnaks in advance
peleg
i it possible?
thnaks in advance
peleg
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
http://www.php.net/manual/en/function.printer-list.php ?
That requires PECL printer extension though (which is only available from cvs).
On the other hand you may use some WinAPI wrapper to call EnumPrinters directly
That requires PECL printer extension though (which is only available from cvs).
On the other hand you may use some WinAPI wrapper to call EnumPrinters directly
Last edited by Weirdan on Thu Oct 14, 2004 8:10 am, edited 1 time in total.
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
can u tell me please where do i get the extension and how
to install it?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
http://www.php.net/manual/en/ref.printer.php
MacPHP Manual wrote:Installation
This PECL extension is not bundled with PHP. Additional information such as new releases, downloads, source files, maintainer information, and a CHANGELOG, can be located here: http://pecl.php.net/package/printer.
Windows users will enable php_printer.dll inside of php.ini in order to use these functions. In PHP 4 this DLL resides in the extensions/ directory within the PHP Windows binaries download. You may download this PECL extensions DLL from the PHP Downloads page or at http://snaps.php.net/.
The PHP manual would be the first port of call.twigletmac wrote:http://www.php.net/manual/en/ref.printer.phpMacPHP Manual wrote:Installation
This PECL extension is not bundled with PHP. Additional information such as new releases, downloads, source files, maintainer information, and a CHANGELOG, can be located here: http://pecl.php.net/package/printer.
Windows users will enable php_printer.dll inside of php.ini in order to use these functions. In PHP 4 this DLL resides in the extensions/ directory within the PHP Windows binaries download. You may download this PECL extensions DLL from the PHP Downloads page or at http://snaps.php.net/.
i'm using php5.0.2 on winxp pro (php_printer.dll is in %php%/ext)
around line 582 in php.ini i added
restarted apache and it works
array(1) { [0]=> array(3) { ["NAME"]=> string(16) "HP OfficeJet V45" ["DESCRIPTION"]=> string(34) "HP OfficeJet V45,HP OfficeJet V45," ["COMMENT"]=> string(0) "" } }
around line 582 in php.ini i added
Code: Select all
extension=php_printer.dllCode: Select all
<?php
/* detect locally shared printer */
var_dump(printer_list(PRINTER_ENUM_LOCAL | PRINTER_ENUM_SHARED));
?>I believe you'll be able to get share name if you pass the name of your local machine as second argument:
Code: Select all
var_dump(printer_list(PRINTER_ENUM_NAME, '\\\\\\\'' . $_ENV['COMPUTERNAME']));