We have a old Perl program that has been around for a decade or so. It originally lived on a Solaris 8 Unix system. In 2008 it was ported to run on a Windows 2003 server.

One function of this program automatically prints a text file to a network printer. The challenge being that the output to the printer needs to be landscape, duplex, edge-to-edge, and scaled to fit 11x8.5 paper. It took quite a bit of work, but in 2008 we got it done.

Here is the code in the Perl program.

use Win32::Printer::Direct; ... $v_error = Printfile("\\\\hardcopy\\pur", $printfile);

This year a new printer is being brought online. Changing the above line to the new printer loses all the print configuration. Nothing we do to configure the printer has an affect on the output produced by the new printer. $v_error = Printfile("\\\\hardcopy\\pml_pur_1", $printfile);

What we can not figure out is how the first printer is working. Looking at the print driver on the win 2003 server, the print server or the printer itself and none of them are setup to produce output in landscape, duplexed, edge-to-edge and scaled to fit.

How could the Perl code possibly be connecting to the //hadcopy/pur printer through the Win32::Printer module? Where could that configuration information be hidden?


In reply to How does a perl program connect to a windows network printer? by iskinner

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.