'sup y'all,

I just got a Dot Matrix printer from a friend, because i wanted to make .matrix music :), and thought let's give it a shot in perl(printing that is).

So i look at some docs, talk to somebody, and bam:

open(PRINTER,">LPT1:") or die "Can't write to LPT1: $!\n"; print PRINTER " HOLY SCHNIKES, I'M A PRINTIN'\!\n"; close(PRINTER);
So i say to myself, "That's cool, now how do i print an image?" Well i thought maybe:
open(PRINTER,">LPT1:") or die "Can't write to LPT1: $!\n"; print PRINTER " HOLY SCHNIKES, I'M A PRINTIN'\!\n"; print PRINTER "Content-Length: $gifsize\n"; print PRINTER "Content-type: image/gif\n\n"; open(GIFIMAGE, "$gif"); while (<GIFIMAGE>){print PRINTER; }; close(GIFIMAGE); close(PRINTER);
That didn't work, so i took of the header, still not what i wanted. So i get on the pm chatterbox, and Macphisot says try binmode FILEHANDLE, didn't work(w or w/o the header). Tye also had some suggestions, but i'll let him post an example here;)

So my questions for you guys are:
    How can i print an image directly to my printer?
    How about 'printing to a file'(*.prn)?
    How can i access/interface the printer(printing device driver)?
    And last, but not least,
    what is the pagebreak character in perl('U @' or in hex '1B 55 00 0C 1B 40' worked for my panasonic .matrix)?

"cRaZy is co01, but sometimes cRaZy is cRaZy".
                                                      - crazyinsomniac


In reply to PRINT AN IMAGE TO LPT1 by crazyinsomniac

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.