;+ ; This procedure prints a postscript file that reproduces the spectrum ; in the plotter. ; ; @keyword filename {in}{optional}{type=string} The postscript filename can be specified ; using this parameter. If omitted, the file will be called 'gbtidl.print.file.ps'. ; ; @keyword portrait {in}{optional}{type=boolean} If set then ; the postscript will be generated in portrait mode instead of the ; default landscape mode. ; ; @keyword device {in}{optional}{type=string} The name of the printer ; to use. If not set, this defaults to the value of !g.printer. If ; !g.printer has zero-length, it falls back to using 'lp'. ; ; @examples ; print_ps,filename='myplot.ps',device='ps2',/portrait ; ; @version $Id: print_ps.pro,v 1.1 2005/03/08 21:13:55 bgarwood Exp $ ;- pro print_ps,filename=filename,device=device,portrait=portrait if (not keyword_set(filename)) then begin ; generate a temporary file somewhere, filename = 'gbtidl.print.file.ps' endif write_ps,filename=filename,portrait=portrait ; check that the file exists if (file_test(filename,/read)) then begin if (not keyword_set(device)) then device = !g.printer if (strlen(device) eq 0) then device = 'lp' ; spool it to the printer printCmd = 'lpr -P' + device + ' ' + filename spawn, printCmd print, filename,' printed on ', device endif end