Help for this page

Select Code to Download


  1. or download this
    system("notepad.exe /p \"filename.txt\"");
    
  2. or download this
    system("print [/D:device] [[drive:][path]filename[...]]");
    
  3. or download this
    $|=1;
    my $i=0;
    ...
    close SPOOL;
    system("copy /B $spoolfile LPT1:");
    unlink $spoolfile;
    
  4. or download this
    open( LPT, "+>LPT1" ) or die "Can't access printer: $!";
    print LPT "Text to print\n\f";
    close (LPT);
    
  5. or download this
    #! perl -w
    use strict;
    ...
        $EndDocPrinter->Call($hprinter) or ShowError('EndDocPrinter');
        $ClosePrinter->Call($hprinter);
    }
    
  6. or download this
    $file="foo.txt";
    print `type $file > lpt1:`;
    print `echo "\f" > lpt1:`;
    
  7. or download this
    if (-e "$ENV{'WINDIR'}/System32/mshtml.dll") {
       $dll = "$ENV{'WINDIR'}/System32/mshtml.dll";
    ...
    
    #note: can't use this to print multiple files
    system("rundll32.exe $dll,PrintHTML $outfile");