Elijah has asked for the wisdom of the Perl Monks concerning the following question:

I am looking for a print module that kind of mimics any OS print window that will popup and allow you to choose a printer or find a printer.

The print modules I have researched like Net::Printer are pretty static and you have to know the name of the server and the port, etc.. Now I could design some front end for it to open a Tk window and enter the info and refer to those "Entries" as variables in the script but this still does not have the "find a printer" function which in my mind is very important. The preceeding only makes that module semi-dynamic. Oh and this will be used in a gui app I have already designed.

Replies are listed 'Best First'.
Re: Dynamic print modules?
by calin (Deacon) on Dec 09, 2003 at 18:23 UTC
    Not sure I understand your question (also you didn't specify your target OS and printing system) , but I find the KDE kprinter program handy. It pops up a dialog where you can choose from different printers / printing systems etc. Just run it instead of LPR (one tip: use kprinter --stdin if you want to send data by piping instead of temporary files as arguments).

    Unix: you can always parse /etc/printcap (the Printer module may do it for you, the docs says it does have a list_printers method)

    Windows: One quick search on CPAN yields Win32::Printer::Enum, a module that enumerates Windows printers, though I can't recommend it because I never used it.