; $Id: lprint.pro,v 1.2 2002/01/14 20:59:26 amunter Exp $
pro lprint,file=file,return=return
;+
; NAME:		LPRINT
; PURPOSE:	Close a PostScript file and print it.
; CATEGORY:
; CALLING SEQUENCE:
;		lprint
; INPUTS:
; OPTIONAL INPUT PARAMETERS:
; KEYWORD PARAMETERS:
;		file=the name of the file to print. Default is idl.ps.
;		return = 1 will execute set_plot,getenv('IDL_DEVICE')
;		printer=the name of the printer. Default is 'ps'
;		Executes the command: lp -dps idl.ps  (for example)
; OUTPUTS:
; OPTIONAL OUTPUT PARAMETERS:
; COMMON BLOCKS:
; SIDE EFFECTS:
; RESTRICTIONS:
; PROCEDURE:
; MODIFICATION HISTORY:
;		D. L. Windt, AT&T Bell Laboratories, November 1989
;		Paul Schleger, Riso National Lab: Added the printer name
;		option and changed 'lpr' to 'lp' so that it runs on
;		an hpux system.
;-
on_error,2
device,/close
if keyword_set(file) then file=file else file='idl.ps'
if keyword_set(printer) then printer=printer else printer='ps'
spawn,'lp -d'+printer+' '+file
if keyword_set(return) then set_plot,getenv('IDL_DEVICE')
return
end
