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

Home » Public Forums » archive » Postscript simplifying and example procedures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: postscript [message #2821 is a reply to message #2767] Mon, 03 October 1994 07:49 Go to previous message
Geoff.Sobering is currently offline  Geoff.Sobering
Messages: 14
Registered: June 1994
Junior Member
Some time ago, I wrote the following short procedures to simplify the
process of directing IDL graphics to a PostScript printer. There are two
routines, 'pso' and 'psc'. 'pso' sets the plot device to "PS", and 'psc'
spools the file to the printer and returns the plot device to whatever it
was.

Most commonly, I construct a graphics command (or commands) with the output
appearing on the screen, then type 'pso', re-execute the graphics
command(s) from the command buffer, and enter 'pso' to spool the graphic to
the printer.

Because of the 'spawn'ed 'lpr' command and the UNIX filename syntax, these
are pretty specific to UNIX, however, they should be pretty easy to adapt
to other OSes.

--
Geoff Sobering (Geoff.Sobering@nih.gov)
In Vivo NMR Research Center
National Institutes of Health

--- pso.pro ----------------------

PRO pso

; 1/17/92 @(#)pso.pro 2.2 In Vivo NMR Research Center, NIH

COMMON ps_switch, old_plot_dev, ps_set

IF keyword_set( ps_set ) THEN BEGIN
message, /inform, 'PostScript output already set.'
ENDIF ELSE BEGIN

; Change the plot-device and flag to 'PS':
old_plot_dev = !D.NAME
set_plot, 'PS'
ps_set = 1

; Put the 'idl.ps' file in the users home directory:
device, file=getenv( 'HOME' )+'/idl.ps'

ENDELSE

RETURN
END

-- psc.pro ----------------------

PRO psc

; 1/17/92 @(#)psc.pro 2.2 In Vivo NMR Research Center, NIH

COMMON ps_switch, old_plot_dev, ps_set

IF NOT keyword_set( ps_set ) THEN BEGIN
message, /inform, 'PostScript output not set.'
ENDIF ELSE BEGIN

; Close the plot-file:
device, /close

; Sent the plot-file to the printer:
spawn, 'lpr $HOME/idl.ps'

; Reset the plot-device and flag:
set_plot, old_plot_dev
ps_set = 0

ENDELSE

RETURN
END
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: PV-WAVE widgets
Next Topic: Re: widget builder?

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

Current Time: Sat Oct 11 20:20:15 PDT 2025

Total time taken to generate the page: 1.67796 seconds