(Author: Roland Rashleigh-Berry
Date: 11 Jun 2006)
Introduction
Spectre has a number of utilities for printing reports. By "reports" is
meant paginated output, typically from "proc report". There are no utilities
in Spectre to help you print unpaginated text files such as program listings
or paginated log files. Use whatever is recommended at your site for these.
PostScript printers
Firstly an explanation is needed about how Spectre handles printing. All
report printing in Spectre is done by converting a text file to a PostScript
file and then sending that to the printer. Most printers connected to a
Unix system are "Postscript printers" which means they understand
PostScript files. Send them a PostScript file and they act like a computer
and obey all the formatting instructions in the PostScript file. PostScript
files contain a lot of formatting instructions, not just the text you want
to print. The utilities Spectre uses for printing are exactly the same
as the ones it uses to convert a file to PostScript that you would later
convert to a PDF. The only difference is that when using these utilities
for converting to PostScript, you specify a printer to the "-p"
option and so the PostScript file produced is sent to a printer and not
saved.
lis2ps
Use the "lis2ps" utility for all text reports (not graphics) that
are created by the reporting system. These are reports that have
a ".titles" member. This way the page layout and margins will get read
from the protocol dataset and the font size and layout will get read from
the titles dataset and your report will get printed in the exact way intended.
You can specify a single file to print, multiple files or files matching
a pattern or even output from a command using $(...) substitution. Here
are some typical calls to "lis2ps", sending the output to the printer "john".
lis2ps -p john myfile.lis
lis2ps -p john myfile1.lis myfile2.lis
lis2ps -p john myfile.lis t_myfile*.lis
lis2ps -p john $(myfiles t_*.lis)
lis2ps -p john $(oporder t*fadu*.lis)
If you want to print output from a validation program, then so long
as your output is identical in layout to the output being QC'ed and you
have followed the naming convention such that your validation program has
the same name but with a "v" at the start then you can use lis2ps to print
it as well. What it then does is ignore the starting "v" character in your
file name and print as normal.
For more information about "lis2ps", consult the header which you can
link to below.
lis2ps
lpr -h
For graphics output produced by the reporting system you
have to use the native printer utility "lpr" with the "-h" option (for
"no header"). This graphics output is already a PostScript file
so you would not use a utility that converts to PostScript. Instead, you
need to send this file directly to a printer using "lpr". Note also that
the "lpr" utility uses the option "-P" (capital "P") for the printer
option whereas all the Spectre scripts use "-p" (small "p") for the printer
option. The reason you specify "-h" to prevent the header being produced
is because if you do not use this option, the file printed will be the
raw
PostScript
file with all the postscript formatting instruction in it. So here is how
you would send a graphics report to the printer "john".
lpr -h -P john g_myfile.ps
For more information about the "lpr" utility, use the command "man
lpr".
a4ps and usps
For paginated text reports that were not produced by the
reporting system, such as ad-hoc reports, use the utility "a4ps" (for A4)
or "usps" (for US Letter). You use these utilities in the same way as "lis2ps"
as shown above. For these two utilities to work, your line size and page
size settings, when you created the output, have to be realistic for a
normal landscape or portrait layout. These utilities will try to fit your
report on the page based on the line size and page size as best as it can
but it will not be able to handle absurd values for these.
Neither "a4ps" or "usps" know what margins to leave around the paper
edges so a default of 1.0 inches is used for all but the right margin (in
the portrait sense) where 0.75 inches is used. You can override these values
using the -l, -r, -t, -b options (left, right, top, bottom). For
example, if you wanted your right margin to be 1.0 inches as well then
you could call the script like this.
a4ps -r 1.0 -p john myfile.lst
For more information about the scripts, consult the headers which you
can link to below.
a4ps usps
PDF printing
If your file is a PDF then you should use the pull down menus in the PDF
reading software to do the printing. Do not use any of the utilities listed
above.
Use the "Back" button of your browser
to return to the previous page.