On Fri, 28 Jan 2005 13:06:09 +0000, O-Dzin Tridral
<[EMAIL PROTECTED]> wrote:
> 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?


It depends on why you're wanting to avoid Word.  Perl doesn't have
built-in typsetting capabilities, so you're going to have to call some
external routine at some point.  One way to do that is through
Win32::OLE, and it's not an entirely horrible way on a Windows
machine.  If you're looking for something more portable, think about
installing LaTeX (MikTeX is the major flavor for Windows) and then
modifying your script to output LaTeX code that you can compile
directly to postscript.  This is what I normally do, but I'm on a
mixed network, so it makes a lot of sense.

If you're unfamiliar with LaTeX, take a look at http://www.latex-project.org/ .

HTH,

--jay

-- 
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