Dear All,
I've written program to print text to lpt1 reading a text file, defining
the font via hp's pcl, and putting the text out, to let a printer have
132 collumn printouts...
it will not run on a co-workers's computer.. I've tried the Printer.pm,
and one other thing from Active state to no avail.
Any ideas?
I'll put the code after the sig..
--
"Games? Solitaire? I have a 3-node VAXcluster, 2 Windows 2000 servers, 1
Windows NT server, 1 Linux server and a direct satellite feed to my
windows desktop background, who needs toys???" - Jim
<><><><><><><><><><> start of code... <><><><>
#!/usr/bin/perl -w
use strict;
# use diagnostics;
my $inrec;
@ARGV >= 1 or die "This program needs the filename to print.\n";
my $sysindsn = $ARGV[0];
print "Printing file:>$sysindsn<\n";
open( SYSIN, "$sysindsn" ) or die "error opening $!\n";
open( LPT, "> lpt1" ) or die "error opening printer port $!\n";
# SET PRINTER FOR LANDSCAPE MODE
# print LPT "\e&l1O\e&l2A\e&l1E\e&l66F\e&l0L";
#
# SET UP PRINTER FOR 132 COLUMNS ACROSS IN PORTRAIT MODE
print LPT "\eP\e(0U\e(s0p16.66h8.5v0s0b0T\e\\";
while ( defined( $inrec = <SYSIN> ) ) {
#chomp($inrec);
print LPT $inrec;
}
#Formfeed the paper out...
print LPT "\f";
# NOW BE NICE AND PUT THAT PRINTER BACK WHERE YOU FOUND IT
print LPT "\eE";
close(SYSIN);
close(LPT);
exit;
#Code Meaning
#\n Newline
#\r Carriage return
#\t Horizontal tab
#\f Form feed
#\b Backspace
#\a Alert (bell)
#\e ESC character
#\033 ESC in octal
#\x7f DEL in hexadecimal
#\cC Control-C
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs