Dear all,
 
We have an application which produces a plain ASCII text file which then needs 
to be printed on a laser printer.
 
Because it gets printed to pre-printed stationery things have to be correctly 
aligned.
 
The method that we have been given is to use MSWord to set the margins and font 
for the file and then print from there.  The process of reading the file in, 
setting margins and sizes has to be repeated every time this process is carried 
out.
 
I would like to know if there's a good way to script this kind of process in 
perl so that if the script is run it will do all the work.
 
The paper size is A4, the printer is an hp9000.
The margins are
(top) 0.42cm, (bottom) 0.44cm, (left) 0.6cm, (right) 0.6cm.
The font is Courier New, Regular, 10pt.

I started playing with the Win32::OLE things, to read the file and set the 
parameters, but now I'm not sure if we need word at all.  Is there a way that 
we can read the file, and output something to go to the printer without Word?

The kind of thing I was doing was:
my $doc = $word->{'Documents'}->Open("xxxxxxxxxx.rpt");
 
#
#+
#  Select the entire document and set the font name and size
#-
$word->Selection->WholeStory;
$word->Selection->Font->{Name} = 'Courier New';
$word->Selection->Font->{Size} = 10;
#

and

my $page = $doc->{'PageSetup'};
$page->{'TopMargin'}    = 11.9;
$page->{'BottomMargin'} = 14.2;
$page->{'LeftMargin'}   = 11.9;
$page->{'RightMargin'}  = 14.2;

Where the measurements are in points (I think).

I'd appreciate any pointer in the right direction.  (We may also go back to the 
people who wrote this adnd ask them to make the file printable in the first 
place, but in the meantime I'd like to automate this as much as possible).

Thank you for any help.

'o-Dzin Tridral

--
the pearl is the oyster's autobiography. (Federico Fellini)
'ö-Dzin Tridral, Project Team Leader, Business Information Systems, Information 
Services, Cardiff University
+44(0)29 20876160, [EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to