Re: Printing within Windows environment [message #12542] |
Thu, 20 August 1998 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Bill Thompson (thompson@orpheus.nascom.nasa.gov) writes:
> I know this question has been asked before, but how does one send a file to the
> printer within IDL for Windows. In Unix, one would spawn the lpr command.
> I've tried spawning "PRINT <filename>", but that doesn't seem to work.
Here is a little routine that I use to print PostScript files
from within IDL on my Windows NT machine. My printer is
attached directly to my computer. The command will have
to be different, probably, for networked printers.
The other day, however, I picked up a piece of freeware
software called PrintFile from the Internet. It is great.
Nice interface (drag and drop if you like), can print
encapsulated PostScript files too, will work with networked
printers as well as non-networked, etc. Unfortunately,
the URL and other information is on my computer in the
office and I am on the road teaching this week. I'll post
the reference here when I get back to my office.
Cheers,
David
-----------------------------------------------------------
PRO PrintFile, filename
Catch, error
IF error NE 0 THEN BEGIN
ok = Dialog_Message("Sorry. Problem printing file.")
Catch, /Cancel
RETURN
ENDIF
; Send a PostScript file to the printer.
IF N_Params() EQ 0 THEN BEGIN
title = 'Open a file for PRINTING...'
filter = '*.ps'
filename = Dialog_Pickfile(Title=title, Filter=filter)
ENDIF
; Out of here if user canceled.
IF filename EQ '' THEN RETURN
; Print it.
SPAWN, 'Copy ' + filename + ' LPT1'
END
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Printing within Windows environment [message #12553 is a reply to message #12542] |
Wed, 19 August 1998 00:00  |
Stubbe F. Hviid
Messages: 2 Registered: August 1998
|
Junior Member |
|
|
William,
Try
copy <filename> <port> /b
where port is the printer port, i.e LPT1: or
\\computer\shared_printer or ...
(replace computer and shared_printer with the names
found on your own local network)
Stubbe
William Thompson wrote in message <6ren47$m40@post.gsfc.nasa.gov>...
>
> Folks:
>
> I know this question has been asked before, but how does one send a file to
the
> printer within IDL for Windows. In Unix, one would spawn the lpr command.
> I've tried spawning "PRINT <filename>", but that doesn't seem to work.
>
> Thank you,
>
> William Thompson
|
|
|