;+ ; NAME: ; PSOPEN ; PURPOSE: ; Opens a file for PostScript graphics output ; CATEGORY: ; Utility ; CALLING SEQUENCE: ; PSOPEN,pfile,font=font,portrait=portrait,landscape=landscape $ ; ,color=color,longpage=longpage,encapsulated=encapsulated ; INPUTS: ; pfile = string specifying name of PostScript output file to create ; KEYWORD PARAMETERS: ; font: specifies PostScript font other than default (e.g., 'times') ; portrait: specifies portrait orientation on page (default) ; landscape: specifies landscape orientation on page ; color: specifies color PostScript output, 8 bits per pixel ; longpage: specifies full length of page available for plotting ; encapsulated: specified the production of an Encapsulated ; PostScript file ; ; Available fonts include AVANTGARDE, BKMAN, COURIER, HELVETICA, ; PALATINO, SCHOOLBOOK, TIMES, ZAPFCHANCERY, ZAPFDINGBATS ; ; OUTPUTS: ; None ; OPTIONAL OUTPUT PARAMETERS: ; None ; COMMON BLOCKS: ; PS_STUFF,Pfont,Dname,Ps_filename ; used by CLOSE_PS to reset font, graphics device type, and to enable ; it to print a ^D to the file for compatibility with QMS printer ; SIDE EFFECTS: ; Opens a file for plotting; sets plot type to PostScript; ; sets !P.FONT to 0 (if a font change requested) ; RESTRICTIONS: ; None known. ; PROCEDURE: ; ; MODIFICATION HISTORY: ; T.J.Hughes, HIA/NRCC , November 30, 1990 ; D. P. Steele, CNSR/UofC, April 21 1993, modified to accept command ; line parameters; added color output option ;- PRO PSOPEN,pfile,font=font,portrait=portrait,landscape=landscape $ ,color=color,longpage=longpage,encapsulated=encapsulated COMMON ps_stuff,pfont,dname,ps_filename nfont='' IF KEYWORD_SET(font) THEN nfont=',/'+font orient=',/PORTRAIT' IF KEYWORD_SET(landscape) THEN orient=',/LANDSCAPE' ystuff='' IF KEYWORD_SET(longpage) THEN ystuff=',YSIZE=24.13,YOFFSET=1.905' encap='' IF Keyword_Set(encapsulated) THEN BEGIN encap=',/ENCAPSULATED' dot=RStrPos(pfile,'.') suffix=StrMid(pfile,dot+1,StrLen(pfile)-dot) IF StrLowCase(suffix) NE 'eps' THEN BEGIN newsuf='' pp='Filename suffix is .'+suffix+'; use .eps instead? ([Y]/N) ' Read,Prompt=pp,newsuf IF (StrUpCase(newsuf) NE 'N') $ THEN pfile=StrMid(pfile,0,dot+1)+'eps' ENDIF ENDIF ps_filename=pfile dvfile="'"+pfile+"'" dname=!D.NAME pfont=!P.FONT SET_PLOT,'ps' dev_string='DEVICE,FILE='+dvfile+orient+nfont+ystuff+encap IF KEYWORD_SET(color) THEN dev_string=dev_string+',/color,bits_per_pixel=8' istat=EXECUTE(dev_string) RETURN END