lprint dump to ps file?
Chad Bender wrote on Feb 08, 2008
Hi -
I'm running iraf 2.12.2a under RHEL5.
Is there a way to get lprint to dump to a postscript file instead of a printer (similar to the ':.snap psdump' functionality for graphics devices)?
Currently, lprint will print just fine to my default printer (e.g. cl> help apextract | lprint). However, on a laptop the default printer may not mean much, so having an actual postscript file that I can work with directly from the linux command prompt would be nice
I've skimmed through the termcap file, but must have missed a psdump equivalent device if it is there.
Thanks
Chad Bender
I'm running iraf 2.12.2a under RHEL5.
Is there a way to get lprint to dump to a postscript file instead of a printer (similar to the ':.snap psdump' functionality for graphics devices)?
Currently, lprint will print just fine to my default printer (e.g. cl> help apextract | lprint). However, on a laptop the default printer may not mean much, so having an actual postscript file that I can work with directly from the linux command prompt would be nice
I've skimmed through the termcap file, but must have missed a psdump equivalent device if it is there.
Thanks
Chad Bender
Mike Fitzpatrick wrote on Feb 08, 2008
LPRINT is basically a front-end to the host lp/lpr commands that allows you to queue files to a particular printer. To create postscript from plain text you would need to instead use a program like 'enscript' as part of the termcap DD string. For example, you could add a device entry to dev$termcap such as:
This would turn the text file into a PS file called /tmp/psdump.ps but note it assumes you've got the 'enscript' task installed on your system. Once you've edited the termcap file, do a 'flpr 0' (zero not oh).
-Mike
psdump|Generic PS file dump:co#80:li#66:os:pt:ta^I:\
:DD=apple,/tmp/asfXXXXXX,!{ enscript -p - $F > /tmp/psdump.ps; rm $F; }:
This would turn the text file into a PS file called /tmp/psdump.ps but note it assumes you've got the 'enscript' task installed on your system. Once you've edited the termcap file, do a 'flpr 0' (zero not oh).
-Mike
Chad Bender wrote on Feb 08, 2008
Thanks - that works great.
Mike Fitzpatrick wrote on Feb 08, 2008
BTW, I should have mentioned that HELP will generate PostScript directly that you can save to a file (e.g. "help prow dev=ps > prow.ps"). The enscript termcap thing is only needed for plain text files, for HELP the PS created by the task is better than the enscripted text version.
-Mike
-Mike
Last post on Feb 08, 2008