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 
Switch to threaded view of this topic Create a new topic Submit Reply
Postscript simplifying and example procedures [message #1607] Wed, 19 January 1994 18:25 Go to next message
deutsch is currently offline  deutsch
Messages: 19
Registered: February 1992
Junior Member
For those who were interested in the PostScript examples I posted earlier
(and confused at my inclusion of non-standard functions), I have made
available a small suite of Postscript handling and supporting procedures.
They're not terribly sophisticated, but they do help with mundane
PostScript printing chores (I think).

They may be found in /pub/idl/postscript in the anonymous FTP account of
orca.astro.washington.edu. Briefly, it contains:

PSSPECXMPL - Heavily commented example of using Postscript hardware fonts;
includes examples of Angstrom, Greek, special, double-stroke
CHARSETS - Prints out whole Postscript hardware font character sets
SETPS - Open Postscript stream with several sizing/positioning options
PSCLOSE - Close PostScript output with automatic printing options
PSOUT - Dump out an image (or graphics window) to a PostScript file
STRN * - Convert any datatype to string with formatting options
VECT * - Convert a vector (array) into a delimiter-separated list
GETDEFVAL ** - Standardized way of retrieving info from a defaults file

* also in the Astronomy Users Library (GSFC)
** called by PSCLOSE but not generally useful unless you have ASTRONLIB.

I'll be happy to take comments or questions regarding these procedures
or the general PostScript topic.


cheers,
Eric


Eric Deutsch Email: deutsch@astro.washington.edu
Department of Astronomy FM-20 Voice: (206) 543-1979
University of Washington FAX: (206) 685-0403
Seattle, WA 98195 Johnson Hall, Room 226
Re: postscript [message #2767 is a reply to message #1607] Tue, 20 September 1994 10:16 Go to previous messageGo to next message
8015 is currently offline  8015
Messages: 52
Registered: November 1993
Member
In article <1994Sep19.175952.24490@msuvx1.memphis.edu>,
PAVAN VEMULAKONDA <pvemulakonda@cc.memphis.edu> wrote:
> I want to convert the image on screen to a postscript file to get a
> printout, how can I do it on IDL.
>
> pavan

I'll assume the display device is correctly set to the window you wish to
convert to a postscript file.

IDL> image = tvrd() ; read the data from the current graphics window
IDL> set_plot, 'ps' ; set the plot device to postscript
IDL> tv, image ; display the data into the postscript file (idl.ps)
IDL> device, /close ; close the device (add'l info sent to idl.ps)

See Chapter 3, "IDL Graphics Devices" of the IDL Reference Guide for a
description of the keywords available for postscript devices. There is
quite a bit of info in there regarding scaling and color mapping.

Mike Schienle Hughes Santa Barbara Research Center
8015@sbsun0010.sbrc.hac.com 75 Coromar Drive, M/S B28/87
Voice: (805)562-7466 Fax: (805)562-7881 Goleta, CA 93117
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: PV-WAVE widgets
Next Topic: Re: widget builder?

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

Current Time: Wed Oct 08 15:54:16 PDT 2025

Total time taken to generate the page: 0.00534 seconds