One of the reasons that printer drivers exist is to provide a more generic interface to the specificities of different types of printers. And, like many modern OS's, Win32 manages the printer drivers for you.
You can poll the Win32 environment to determine what printers are available. For that, use the Win32::Printer::Enum module.
That module will tell you the driver names and ports on which the printers may be found.
After figuring out what printer you want to print to, you can use the Win32::Printer module to standardize your printing in a more generic way so that you don't have to deal with the differences between different makes of printers.
Be sure to read the POD for these modules. Installation appears to be a little tricky.
Another thought:
Not worrying about OS-dependant printing issues is one good argument for web-based applications versus workstation based applications. Most web browsers already know how to print. Creating a web-based application (Internet or Intranet) allows you to gloss over details such as "how the hell do I print?" If you're striving for quick development time, it's hard to beat a web-based application when you start needing to do things like printing and screen formatting. If development time isn't an issue, and a polished look is, then I guess it's time to turn to workstation-based applications. Of course one of the reasons people turn to Perl is quick development time. It is in keeping with that philosophy that I mention the web-based approach.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|