Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I obtain list of available printers?

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
Other than keeping a MySQL table with list of known printers, how could I dynamically fill a select box with available printers in network?

Thanks to jpadie's much older post, I am able to print to any network printer by using

Code:
<?php
$filename = "c:\appl\forms\magnowr.pcl";
///////
ob_start();
include $filename;
$contents = ob_get_contents();
ob_end_clean();
///////
$handle = printer_open("\\\\print_server\SHARED_NAME");
printer_set_option($handle, PRINTER_MODE, "raw");
printer_write($handle,$contents);
printer_close($handle);
?>

I would like to fill in the target printer dynamically. Is this possible or am I stuck with maintaining a table?

Thanks!
 
There is a list_printers function mentioned but abonded, have a google for printer_list which seems to be ont the PHP site

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
I searched for "list printer" in php.net and came back empty in both function and document ... This was before I posted the question here ...

Thank you guys!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top