XFAX 4.3a - User's Guide
8. Overlay files and cover sheets
Overlay files are files store in the XFAX fax format which can be used as cover pages or merge on to each fax page sent as a form template for example. This makes it possible to send faxes with a very nice layout. For example you can send order confirmations with your logotype and other form elements being merged on to raw text data which contains the order data.
8.1 Using overlay files as forms and cover pages
In order to generate an overlay file you use the XFAX Windows client. Put together your document in an application such as Microsoft Word and then print the document choosing the XFAX printer. When the XFAX dialog show up, press "Store". You will be asked for a name to "Store Coverpage As". Enter a filename. Then a XFAX fax file will be generated and stored on the UNIX server in the XFAXDIR/covers directory. This file can then be used as an overlay file.
In order to use an overlay file with faxsend you can do this:
faxsend -overlay /etc/xfax/covers/orderform 55576861 orderdata.txt
You can also use one overlay file as cover page and another overlay file as form for the rest of the pages:
faxsend -cover mycover -overlay_repeat -overlay_skip 1 -overlay orderform 55576861 orderdata.txt
This is an easy way for adding a form including the company logo to outgoing purchase orders or to add a nice layout in an e-mail to fax gateway for example.
8.2 Cover sheets the old way
It is quite easy to make neat cover sheets, page headings and page footings in XFAX with logotypes and other refinements. The principle is that you design your cover sheet (or whatever) in some suitable program which can make a print-out in the form of PCL code; to be more precise the data which is generated by an HP Laserjet Plus, for the file. For example, you can use Word or Pagemaker in Windows. You simply position the codes in the document where you want to have the name of the sender, recipient, etc. These codes should be in a typeface that means that the text is stored as text and not converted to screen data. In order to avoid this you should use the typefaces that have been built into XFAX. These are the same typefaces that are in a Microsoft Z1A font cassette. These typefaces are marked with a small printer in the typeface list in the application when the right printer is chosen. Print out the document to file. Stage 1 is now completed.
The next step is to replace the filed codes in each fax that is to have a cover sheet with the real values for sender, recipient, etc. This is best done with the command faxsr (Search and Replace). faxsr takes a number of arguments of the type "code = value" and then searches for the sequence ":code:" and replaces this with the values given. If, for example, you have set in the code ":REC:" in the cover sheet template ETCDIR/cover.icab where you want to have the recipient's company name and :RECNAME: where you want to have the name, faxsr is called up in the following way:
# faxsr ETCDIR/cover.icab "REC=Infoflex Connect AB" "RECNAME=Stefan Norlin" >cover.final
Note that the result is written to "standard out" in the example above and that above the field names are arbitrary.
At the end of a file which is created with a printout in Windows, a page feed (hex 0x0c) and Esc E (hex 0x1b 0x45) is always added to restore the printer after the print-out. faxsr bypasses these three characters automatically unless the argument -no_skip is given.
For each fax that is to be sent, the template is "mixed" with the variable data with the aid of the command faxsr.
Some special field codes:
Replaced with the contents in the file which is indicated as an argument. E.g. "MESSAGE=/tmp/message" insert the file /tmp/message instead of the code.
The current date is inserted. The format is yyyy-mm-dd
The current time is inserted. The format is tt:mm.
Note that the script xfax automatically searches for a file cover under ETC-DIR. If this file is there it will be used as a cover sheet. You are welcome to look in xfax to find what field names have been used for the call to faxsr.
There are some things you may need to change in the PCL file, namely:
The symbol set up, XFAX wants to have Latin-1. Change any other control codes for the symbol set up to Latin-1 (ISO 8859-1). The control codes for Latin-1 are ESC(0N, Roman-8 ESC(0U etc. This is described in more detail in a HP Laserjet manual.
If the MESSAGE codes lie before the screen data in the PCL file you obtain the following scenario. Where you set in the MESSAGE field, the files given are set in during the operation. If the files are more than one page long so that a page break is set in, the screen data (logotype, graphics, etc.) is set in on the page. Therefore, this code must be set in last in the document.
Last but not least. You are welcome to contact your retailer or Nordic Messaging Technologies if you need any help in setting up and using cover sheets./