crazyinsomniac has asked for the wisdom of the Perl Monks concerning the following question:
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:
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"; 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;)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);
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PRINT AN IMAGE TO LPT1
by AgentM (Curate) on Nov 18, 2000 at 04:21 UTC | |
by Fastolfe (Vicar) on Nov 18, 2000 at 04:28 UTC | |
by tilly (Archbishop) on Nov 18, 2000 at 15:44 UTC | |
by AgentM (Curate) on Nov 18, 2000 at 04:39 UTC | |
by extremely (Priest) on Nov 18, 2000 at 12:47 UTC | |
by Fastolfe (Vicar) on Nov 18, 2000 at 05:12 UTC | |
by jepri (Parson) on Nov 18, 2000 at 19:56 UTC | |
by AgentM (Curate) on Nov 19, 2000 at 00:36 UTC | |
by jepri (Parson) on Nov 19, 2000 at 10:49 UTC | |
by crazyinsomniac (Prior) on Nov 18, 2000 at 04:32 UTC | |
|
Re: PRINT AN IMAGE TO LPT1
by jepri (Parson) on Nov 18, 2000 at 19:47 UTC | |
by Albannach (Monsignor) on Nov 18, 2000 at 20:46 UTC |