I believe I am nearing the end of month long porting of a rather extensive, 1500 line, 15 year old Perl application that used to run on one of our old Solaris Unix boxes to running on our new Windows 2003 box.

I believe the last obstacle to over come is to print a text file to a network printer in a landscape orientation.

After much searching I have found the Win32::Printer and Win32::Printer::Direct modules. But I'm not sure how to make use of them to achieve my goal.

Creating an instance of Win32::Printer, I can supposedly tell it to print in landscape.

use Win32::Printer; $foo = new Win32::Printer( orientation => LANDSCAPE );

With Win32::Printer::Direct, I can easily print the text file.

use Win32::Printer::Direct; Printfile('\\\\hardcoyp\\ApDev','test.txt');

How the halibut can I combine these features? Assuredly there has got to be a way, but what it is I can not fathom.

Win32::Printer
Win32::Printer::Direct

My experience with Perl is a bit stale dating from the late 90's. And then I was just a novice making simple modifications to canned CGI scripts that sent e-mails from form submits. I do not think I understand modules well enough to know how to get the more specific 'Direct' module to use features of the more general 'Printer'? I don't even understand enough to know if that is a sensible question to ask.

TIA
Ian


In reply to Print a text file to a Windows network printer in a landscape orientation. 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.