Re: Multiple Line output using Win32::Printer




"l v" <veatchla@xxxxxxxxx> wrote in message
news:1149800427.838297.218040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Jack D wrote:
I'm trying to output mutilple lines to a printer using Win32::Printer. I
have only suceeded in printing one line so far. Does anyone know how
force
it to print multiple lines? The output is shows rectangles in between
each
word.

Sample code below

use strict;
use Win32::Printer;
my @array = keys %ENV;

printMultiple();

sub printMultiple {
my $dc = new Win32::Printer( papersize => A4,
description => 'Test,
unit => 'mm') or die "Failed
to
create printer object";
if ($dc) {
my $textToPrint = join("\r\n",@oldarray);
my $font = $dc->Font('Times New Roman', 12);
$dc->Font($font);
$dc->Color(0, 0, 0);
$dc->Write($textToPrint, 10, 10);
$dc->Close;
}
}
__END__

Jack



What does you print show when you change the "\r\n" in the join to ':'?
my $textToPrint = join(':',@oldarray);

Is this a trick question? It prints the colon of course.

Jack


.



Relevant Pages

  • Follow Up [was Re: Multiple Line output using Win32::Printer]
    ... my @array = keys %ENV; ... use Write2 or print the array element by element ...
    (comp.lang.perl.misc)
  • Re: comparing some but not all fields in lists
    ... and what's in common." ... I should compare only 3 of the 82 fields in each list. ... comparing all 82 fields as a single array element. ... cannot handle multiple keys as you want it to. ...
    (perl.beginners)
  • Re: Build an array from a text file
    ... Now that I have created my array, ... The dictionary object has a 'keys' method that returns a 0 based array ... Dim vArray As Variant ... dictionaries, so any help would be great! ...
    (microsoft.public.word.vba.general)
  • Re: Nugget - Using control references
    ... until someone decides they want to save a 3D array. ... If the users are likely to add elements to the middle of the enum, you should save and load by the enum text. ... What you can try is this - save both the string and the number. ... Unused keys are not deleted.  When the number of elements in an array is reduced, the key entries still exist in the file. ...
    (comp.lang.labview)
  • Re: hash sortieren nach werten, hash in =?ISO-8859-15?Q?popupmen?= =?ISO-8859-15?Q?=
    ... Dieses Array gibst Du bei -values an. ... Du schreibst Dir eine Funktion, die Dir die Keys ... des Hashes in der Sortierung der Werte liefert. ... values ist eine Referenz auf ein @rray, ...
    (de.comp.lang.perl.cgi)