comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Printing PS Files on Windows Machines
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Printing PS Files on Windows Machines [message #12593] Tue, 25 August 1998 00:00
Stubbe Faurschou Hvii is currently offline  Stubbe Faurschou Hvii
Messages: 2
Registered: January 1996
Junior Member
Hi

If you simply want to dump a file to the printer (PS or otherwise) here is
a small IDL program that does the job:
(without using the spawn procedure)

PRO print_file, filename, PORT=PORT

if n_elements(PORT) eq 0 then PORT='lpt1'

; *** read file into buffer
openr, unit_read, filename, /GET_LUN
fs = fstat(unit_read)
buffer=bytarr(fs.size)
readu, unit_read, buffer
close, unit_read, /all
free_lun, unit_read

print, 'sending ', fs.size, ' bytes to ', PORT

; *** write buffer to PORT
openw, unit_write, PORT, /GET_LUN
writeu, unit_write, buffer
close, unit_write
free_lun, unit_write
END

You set the print port using the keyword PORT='port name'. The default port
is 'lpt1' but it can be set to anything.

Stubbe

davidf7203@my-dejanews.com wrote:

> Hi Folks,
>
> I wanted to follow up on a discussion last week about
> printing PostScript files on Windows machines. Here is
> the URL to a small freeware utility program named
> PrintFile that I think is terrific. You can set it up
> to be a drag and drop operation, or you can simply
> Spawn the program from within IDL (use the "start"
> command if you are on Windows NT to avoid the program
> blocking the IDL command line).
>
> http://hem1.passagen.se/ptlerup/prfile.html
>
> The author of this program, Peter Lerup, also wrote
> the useful PS2EPS program for the Macintosh.
>
> Cheers,
>
> David
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>





--
---------------------------------------------------------
Stubbe Faurschou Hviid tlp. (+45) 35 32 04 15
University of Copenhagen fax. (+45) 35 32 04 60
Niels Bohr Institute
�rsted Laboratory Email: stubbe@fys.ku.dk
Universitetsparken 5 WWW: http://ntserv.fys.ku.dk/mars.htm
DK-2100 Copenhagen �
Denmark
Re: Printing PS Files on Windows Machines [message #12614 is a reply to message #12593] Mon, 24 August 1998 00:00 Go to previous message
Brad Gom is currently offline  Brad Gom
Messages: 49
Registered: August 1997
Member
davidf7203@my-dejanews.com wrote:

> Hi Folks,
>
> I wanted to follow up on a discussion last week about
> printing PostScript files on Windows machines. Here is
> the URL to a small freeware utility program named
> PrintFile that I think is terrific. You can set it up
> to be a drag and drop operation, or you can simply
> Spawn the program from within IDL (use the "start"
> command if you are on Windows NT to avoid the program
> blocking the IDL command line).
>
> http://hem1.passagen.se/ptlerup/prfile.html
>
> The author of this program, Peter Lerup, also wrote
> the useful PS2EPS program for the Macintosh.
>
> Cheers,
>
> David
>

This is a great program. I just hacked XWINDOW.PRO and PS_FORM.PRO a little
bit to add print buttons which spawn PrintFile. PrintFile in turn spawns
GhostScript and sends the converted file to a non PS printer. This lets me
use all the great features of xwindow to create a predictable postscript
file, as well as printing the file directly to a non postscript printer.
This way I get an immediate hardcopy, and a saved file.I've never had
reliable results with other ways of dumping a plot to a printer without
alot of extra code in my plotting programs.

yippee.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: widget with check table ??
Next Topic: Re: Returning pointers from C DLL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:37:14 PDT 2025

Total time taken to generate the page: 0.00633 seconds