Re: Printing on Win platforms [message #18221] |
Thu, 09 December 1999 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Bernard Puc (bpuc@va.aetc.com) writes:
> I predominantly work with IDL on unix systems. But now I have a
> routine that needs to be able to print text on a win95/98 platform as
> well. On unix, I would create a temporary file with the text to be
> printed and then do SPAWN, 'lpr '+tempfilename to print the file. Is
> there an equivalent method for win?
>
> How about a better method for either?
>
> (Dave, do you cover this in your updated book?)
No I don't cover it, but I like to use a little piece of
freeware named PrintFile for these purposes. It is easily
configured to print PostScript or text files. It is written
by Peter Lerup and can be found here:
http://hem1.passagen.se/ptlerup
To print a text file from within IDL on my Windows NT
machine, I can type this:
IDL>Spawn, 'Start C:\"Program Files"\printfile\prfile32.exe testfile.txt'
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Printing on Win platforms [message #18222 is a reply to message #18221] |
Thu, 09 December 1999 00:00  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
Bernard Puc wrote:
> I predominantly work with IDL on unix systems. But now I have a
> routine that needs to be able to print text on a win95/98 platform as
> well. On unix, I would create a temporary file with the text to be
> printed and then do SPAWN, 'lpr '+tempfilename to print the file. Is
> there an equivalent method for win?
Ah the good old days when I drove MSDOS. How about this:
cmd = ''
case !version.os_family of
'Windows' : cmd = string(filename, format='("copy ", a, " prn:")')
'unix' : cmd = string(filename, format='("lpr ", a)')
else : message, 'I don't know how to print on this platform', /continue
endcase
if (cmd ne '') then spawn, cmd
> How about a better method for either?
I'll have to think about that.
Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
|
|
|