Print spooler
There are times where you want to prepare printout's without actually
printing them e.g.
The 'Print Spooler' option allows reports to be spooled (stored) on the disk and then manipulated/printed at a later date. This option is available from
Within these options when you are asked 'Display/Print' you will find the option 'S'pool.
To manipulate the output use:
'T'ext Utilities - 'P'rint Spooler
Delete
Deletes the current file from the spooler list. Once
deleted you CANNOT access the data contained in the report
without re-running the original report.
Print
Prints the report. By default it will be sent to the
originally selected printer. You are given the choice to
enter a different printer command.
Note: This should be
the FULL printer command and not just the name of the
printer e.g. lp -dmain. Once printed the file will remain
on the spooler list, it is NOT automatically deleted.
Reduce
If you want to keep big reports on the list e.g. invoice
runs, it is a good idea to shrink (compress) the data to
save wasting hard disk space. This option gives you the
choice of gzip or compress. Whenever the compressed file
is printed or viewed the file will be expanded beforehand.
Copy
This allows you to make a copy of the corresponding data file
elsewhere on the hard disk. You can also copy this
file to a floppy if the filename you enter starts with a:
(use a dos formatted floppy).
View
Rather than printout on the printer the contents of the
file you can use this option to view the file. This option
uses the utility 'less' as the viewer you will find the
manual page for less in the text utilities manual page
options. At a minimum use:
h - Help - Show the available options q - Quit - Quit back to the menu f - Forward - Screen forward b - Back - Screen back
Note: Most of the printed report have a heading made up of graphics characters. These characters don't always display correctly with less and may 'not look nice' - this is purely cosmetic and you should ignore it.
Mail it
Send the selected report to a mail address
You will be prompted for a subject and address, if either are left
blank you will be returned to the menu.
You have the option to:
Send it
Send the report to another command
The selected report will be piped to another application or
command. You will be prompted for the command.
To avoid congestion and to store reports you may need in the future you can be means of the 'A'rchive option move the reports to one side. You can switch the print spooler to use the archive option by entering an asterix (*) on the Text Utilities menu. The 'Print Spooler' option will change to 'Print (ARCHIVE)'. To switch back to the normal spooler use another *.
When the list of spooled files is displayed pressing the 'SPACEBAR' will mark that file. Marked files will be displayed using colour event 218.
If you want to mark multiple files you can press the slash ('/'), you will be asked for the text to search for. The system will look at all spool entries and if the text is found in the description line it will be marked automatically. If the file is already marked it will be un-marked.
If the search criteria starts with a < > or = the system will assume you are doing a date search e.g. <12.08.01 will mark all entries prior to 12th Aug 2001, >14.12.00 will mark entries after 14th Dec 2000.
When you exit the print spooler you will be advised of the marked files and asked what you would like to do with them:
Delete - File will be removed from the system
Archive - File will be moved to the archive area making it
invisible to the normal print spooler.
In both cases, the prompt line will contain the option 'All', if All is selected then all marked files from that point onwards will be processed as if you had selected 'Yes' on each one.
New PrintersAdding printers or editing settings
Once that is done and the printer works from the Operating System prompt add it to the vet system via the option on the parameters menu.
There are two variables passed to the script, and these are a) the name of the printer and b) the name of the spooled file. These can be accessed by $1 for the printer and $2 as the spool file.
For example you may wish save a printout and at the same time make a hard copy. The following script will perform this:
: # Sample shell script to save a copy of the invoice run # Aug 95 # The output file will always be in $1 f=$1 # Get todays date in the format ddmmyyHHMM d=`date '+%d%m%y%H%M'` # Make a copy of the file for archive purposes # As this is for invoices add .inv to the filename cp $f /u/vetdata/text/$d.inv # print the file as normal lpr -c -s -dlaser $f
/u/vetdata/twm.ps
Give it execute permission with chmod a+x /u/vetdata/twm.ps
Now you can enter as the printer command:
/u/vetdata/twm.ps
| Top | Classic | New-Style | Chapters | Sections | Index | Search |