Making the Premier Open-Source Fax Management System Even Better
faxcover is normally invoked by the sendfax(1) program to generate a cover page for each outgoing facsmile.
faxcover works by creating a POSTSCRIPT dictionary that contains definitions for the variable information that is to be placed on the facsimile cover page. Specifically, a dictionary with the following symbols are defined:
Symbol Description Symbol Description
to destination person from sending person
to-company destination company from-company sender's company
to-location destination geographic location from-location sender geographic location
to-voice-number person's voice phone number from-voice-number sender's voice phone number
to-fax-number destination fax phone number from-fax-number sender's fax phone number
from-mail-address sender's e-mail address
comments unbroken comment string commentsX X'th line of comments
regarding Re: subject CommentX similar to commentsX
pageWidth page width in millimeters page-count # pages other than cover page
pageLength page length in millimeters todays-date current date and time
If the comments string is longer than maxlencomments characters, it is broken, on word boundaries or instances of ``\n'', into multiple POSTSCRIPT strings commentsX where X is the line number; e.g. comments2 for the second line of comments. Long substrings without whitespace which exceed maxlencomments are also broken. By default faxcover will generate 20 commentsX strings, emitting null string values for empty lines. This number can be changed with the -m option; see below. maxlencomments is changed with the -z option; see below.
Note that use of commentsX with non-fixed-width fonts can lead to spatial problems where characters run off the edge of the generated cover page. In such cases, use of BreakIntoLines (see below) may be a more suitable approach.
CommentX is similar to commentsX except that its values are created only by breaking comments on instances of ``\n'' and not otherwise. maxlines does not affect CommentX
faxcover also emits a POSTSCRIPT procedure for breaking comment strings into multiple lines using the POSTSCRIPT font metric information. This procedure is named BreakIntoLines and has the following usage convention:
%<line-width> <line-height> <x> <y> <string> BreakIntoLines -
eg
/rule (_____________________________________________) def
/lw rule stringwidth pop def /lh 30 def
/y 191.4 def /x 0 def
y -30 0 { x exch moveto rule show } for
lw lh x y comments BreakIntoLines
where the width of the rule controls the length of each line of comments (note that it is made slightly shorter here for the purpose of presentation), x and y are initialized to coordinate locations on the page where the comment string should be imaged, and the number 30 is the inter-line spacing appropriate for the font used to image the comment lines.
If information is unavailable for an item, the associated POSTSCRIPT symbol is defined to be a null string.
Following the definition prologue, a cover sheet template file is copied. This file is expected to be a POSTSCRIPT program that uses the generated strings to create a cover page. The template must include a showpage operator to cause the page to be imaged. The above symbols will be defined in the current dictionary. A trailing end operator is supplied by faxcover, so any manipulation of the dictionary stack should leave the current dictionary on the top of the stack on completion.