Postscript simplifying and example procedures [message #1607] |
Wed, 19 January 1994 18:25  |
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 #2821 is a reply to message #2767] |
Mon, 03 October 1994 07:49  |
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
|
|
|