PRO PSCLOSE, NORMPS3=NORMPS3 ;+ ; NAME: ; PSCLOSE ; PURPOSE: ; Closes a PostScript output file (opened by OPEN_PS). It then reopens ; the file for Update, and appends a D to the file for compatability ; with the QMS PostSCript printer ; CATEGORY: ; Utility ; CALLING SEQUENCE: ; PSCLOSE ; INPUTS: ; None ; OPTIONAL INPUT PARAMETERS: ; None ; KEYWORD PARAMETERS: ; /NORMPS3: If set, prevents the output PostScript file being ; reopened to remove the spurious PS-Adobe-3.0 ; characters in the first line that mess up the ; PostScript printers. ; OUTPUTS: ; None ; OPTIONAL OUTPUT PARAMETERS: ; None ; COMMON BLOCKS: ; PS_STUFF,pfont,dname,ps_filename ; SIDE EFFECTS: ; Closes the file PS_FILENAME ; Appends a D to that file ; RESTRICTIONS: ; None known ; PROCEDURE: ; ; MODIFICATION HISTORY: ; T.J.Hughes, HIA/NRCC , November 30, 1990 ; D.P.Steele, CNSR/UofC, April 21, 1993, modified from CLOSE_PS.PRO ;- COMMON ps_stuff,pfont,dname,ps_filename ; +-------------------------------------------------------------------+ ; |Close PS_FILENAME so that all the graphics buffers are cleared. | ; |EMPTY didn't seem to do it, and we can't use FLUSH,UNIT because | ; |we don't know what unit has been used. | ; +-------------------------------------------------------------------+ DEVICE,/CLOSE ctrl_d=string(4b) ; +-------------------------------------------------------------------+ ; |Open the same file again, for updating, and append a D to | ; |it | ; +-------------------------------------------------------------------+ GET_LUN,unit OPENU,unit,ps_filename,/APPEND PRINTF,unit,ctrl_d CLOSE,unit FREE_LUN,unit ; +-------------------------------------------------------------------+ ; |Reset the output graphics type to what it was before OPEN_PS was | ; |called, and reset !P.FONT similarly | ; +-------------------------------------------------------------------+ SET_PLOT,dname !P.FONT=pfont ; +-------------------------------------------------------------------+ ; |Edit the first line of the file to remove the PS-Adobe-3.0 string | ; |that messes up (at least) the b/w PostScript printer. | ; +-------------------------------------------------------------------+ IF KEYWORD_SET(normps3) THEN GOTO,done pstext=qgetfile(ps_filename) pstext(0)=STRMID(pstext(0),0,2) mputfile,ps_filename,pstext done: RETURN END