Programming Fax Modems under DOS, Windows and OS/2 (v7.6a)

By Alan Hart, last updated 1998-09-30 (but needs an update still).

Scope

The purpose of this article is to outline the options open to you if you want to write a DOS program to control a fax modem, with particular reference to sending faxes. Any relevant information for Windows and OS/2 will also be included as soon as people send me it. This is not an exhaustive list of your options, but it does contain everything I've come across.

Disclaimer: This information does not come directly from reliable sources. While I have tried to ensure that this information is accurate and believe it to be so, I take no responsibility for any inaccuracies. I haven't tried most of the software listed below. I'm just trying to report what I've gleaned from other people.

So how do I program a fax modem?

  1. Your first option is to buy a specific fax card that has an API (application-programmer-interface). The programmer is provided with software - either for the PC, or on the card itself - and documentation, which together make it easy to control the card. Probably the cheapest way to do this is with a CAS fax/modem (e.g. the SatisFAXtion series from PureData). CAS is an API for modems created by Intel. It seems that Intel doesn't have as many CAS products as it used to, but still supports modems and markets CAS software. Pure Data now seem to be known as WildCard Technologies and are actively developing CAS modems, having taken over the SatisFAXtion line from Intel. They seem to be more serious about CAS than Intel were, and have secured agreements ensuring CAS will work with all the major operating systems. Pure Data seem very keen to make CAS really happen.
  2. If you can afford to use rather more upmarket equipment, you can buy a GammaFax or Brooktrout intelligent fax card for about $600. Both these brands are reputed to be of very good quality. An API/toolkit for the GammaFax series costs a further $500 or so; alternatively Stylus Innovation, Inc. have a Visual Basic custom control (VBX) called Visual Fax which provides high level support for both GammaFax and SatisFAXtion. ITI Software of Montreal have a nifty-looking CAS/Brooktrout fax toolkit called Multi-Fax which supports multiple CAS modems under Windows, DOS and extended DOS. Comet/FaxPro is a CAS toolkit for FoxPro, dBASE, Clipper and QuickSilver.

    Another option that has recently come to my attention is Vidicode's Argus modem. Vidicode, it seems, sell fully programmable modems with built-in hard drives. The Argus, intended mainly for use with mainframes and minicomputers, can receive text files via its two serial and one parallel ports. The only format requirement is that the destination fax number is in the first line of the file, and a special escape string is available to flag end of page. The modem reads the first line, strips off the number, and faxes it out. The user can program the modem to merge the letter with a letterhead, signature or footer. Further information from sales@vidicode.com.

    In any case, regardless which of these we are considering, if you need your software to work with ordinary modems, these solutions aren't any good for you.

  3. Buy a book on the subject that comes with a free disk. Some contributors recommended "Introduction to Data Communications: A Practical Approach", published by Whale Lake Press (1994), ISBN 0-9698614-0-0 (said to be well-written and comes with some C software on disk). Also worthy of mention is "Programmer's Technical Reference: Data and Fax Communications" by Robert L. Hummel. David Empson comments that this book covers the basics of data communications quite well, and in the first quarter of the book covers topics such as the AT command set, the different types of UART and the rudiments of fax transmission including T.4 -- but not in a lot of depth. The next three-quarters are essentially reference appendices, and although a lot of information is there for would-be fax programmers, David suggested that there were some omissions and found it quite disappointing that there was no tutorial on sending a fax.

    A previously-recommended PC magazine-related publication called "C++ communication utilities" by Holmes and Flanders, ISBN 1-56276-110-2, published by Ziff-Davis, is apparently now out of print. They develop comms and fax applications as the book goes on, and a disk is included with all the source code. It requires a class 1 compatible fax modem. It costs UKP 28.00 or so, which is a lot less than commercial software, but you should check that the code redistribution terms are appropriate for your application.
  4. The newest publication on the market seems to be "The Fax Modem Sourcebook", ISBN 0 471 95072 6, by Andrew Margolis, who also wrote the toolkit mentioned below, a copy of which is supplied with the book (non-commercial licence). The book covers T.4, T.30, TIFF/F, Class1/2/2.0, and other topics, and there is some extra information on the disk on topics of less universal interest such as BFT and ELM. It's published by John Wiley, 1995, costing around UKP24.95, or US$34.95.

  5. If your application simply requires batch sending of faxes, e.g. from the DOS command line, there is a shareware product called BGFAX. The executable is available via the preceding link or at ftp.csn.net in /Computech. BGFAX is probably a bit big (100K or so) to be loaded from within another application, but it might suit you, perhaps to be run from a batch file after your program has quit. The shareware version of BGFAX appears not to be crippled (although it has one slightly irritating feature until you register, which costs $25). BGFAX supports at least class 1, 2 and 2.0 fax modems. See also the demo Async Pro EXE files, referred to below. QuickStar Fax Pro is an MS-DOS shareware program that allows you to send plain text FAX from your PC computer, using a Class 1 or Class 2 fax/modem. It claims to send faxes very fast. The downloadable version essentially works but (I believe) has a minor crippled feature.

  6. A number of commercial libraries are available for adding fax capability to your own code. For many of us this is probably the most sensible way to go. One person gave me a strong recommendation for TurboPower Software's Async Pro (curently at release 2.x). This is a royalty-free library supplied with source (and a version for Windows has just become available). The package has libraries for sending, receiving, converting, viewing and printing fax files from your programs written in C/C++ [DOS (now obsolete) / Windows], Delphi and C++ Builder. You also get serial I/O and Modem control libraries. Further information on the library is available from their website.
  7. Also available from the same site is faxdem.exe . This is a self-extracting archive of some demo EXE files written using the fax library; these would be sufficient in themselves for basic DOS command line faxing. Further information is available by e-mail from 76004.2611@compuserve.com or from info@tpower.com. The library costs about $220.

    Delphi programmers might also want to consider MicroHelp's Fax Plus 1.1. This appears to be a library allowing programmers to send and receive faxes using a class 1, 2, or 2.0 fax modem from a document in ASCII text, .BMP, .PCX or .DCX format. It apparently costs US$249. Microhelp can be contacted at +1 800 922-3383, or by fax at +1 404 516-1099. For further information see Borland's Delphi Solutions (you will have to search the list of products somewhat).

    Data Techniques' FaxMan is a VBX/DLL library for C, C++, Visual Basic and Delphi, with which you can add fax send/receive for "standard fax modems" to your applications. Pronexus VBFax is a sophisticated VBX which will control up to 10 fax modems at once.

    Margolis & Co of London have also produced a fax toolkit. Like most of the other products listed here, I can't endorse this in any way, as I've never seen it, but I quote Andy Margolis (margolis@cix.compulink.co.uk) below as I think it is of considerable interest. One major advantage of Andrew's product is that you can have it to try out and play with very cheaply.


          You should also know about my FAX Toolkit, which includes
          routines for
    
          1.   Turning text files into fax files (TIFF Class F) with
               options for 1-D and 2-D T.4 encoding or T.6 encoding,
               both fine and normal resolution.
    
          2.   Sending and receiving faxes using either class 1, class
               2 or class 2.0 fax modems.  Fine and normal resolution
               with 1-D and 2-D T.4 faxes supported if the modem can
               handle it.  Error correction also supported but only
               on those class 1 modems that have high-speed HDLC the
               capability.  2.0 support fairly untested,
    
          3.   Outputting received faxes to a variety of devices : as
               well as IBM graphics screens, a range of printers are
               supported, and also file conversion to uncompressed
               TIFF bit images.
    
          Full source code is provided (ANSI C : the code is tested
          and developed on PCs, and the version provided includes
          some machine dependent routines in assembler for direct
          screen output and around eight routines for low-level i/o).
    
          The source code is available on PC disk on a non-commercial
          basis for only 30 UKP plus delivery (Visa and M/C credit
          cards accepted) ; this gives a licence to use and play with
          the code, but not to use it in any products available for
          sale.  Commercial licences by negotiation.
    
          (I'm not sure about the netiquette of publicizing this via
          Usenet, which is why I've not posted).
    
          Andrew Margolis
          MARGOLIS & CO
          228 Alexandra Park Road,
          Wood Green,
          London N22 4BH, UK
    
    


    As mentioned above, a non-commercial copy of the code is provided with Andrew's book.

  8. Miscellaneous other possibilities. There are three products (that I know of) for FoxPro programmers wanting to send faxes. Firstly, there's Comet/FaxPro as mentioned above, which is also suitable for dBASE, Clipper and QuickSilver.
  9. Secondly, there's CommWorks by Pinnacle Publishing. I don't have an e-mail address for them, but their sales telephone number is +1 800 788-1900; fax +1 206 251-5057. They also have a BBS on +1 206-251-6218 (9600,N,8,1). On CompuServe, type GO PINNACLE.

    The other FoxPro fax solution is SilverFox by SilverWare, Inc. It handles various forms of communications including X/Y/Z-Modem as well as a full range of fax functions. It's reputed to be a very solid product. SilverWare are on (voice) +1 214 247-0131 and their address is 3010 LBJ Freeway, #740, Dallas, TX 75234, USA.

    Windows programmers might want to consider interfacing to a commercial fax package. I understand that WinFax PRO v4.0 supports DDE, and could presumably therefore be convinced to send faxes for you. Equisys' Zetafax is a PC LAN fax package. Users on the network can send and receive faxes straight from their PCs. One PC on the network needs to be set up as a fax server; connected to it are one or more fax modems or fax cards. Zetafax supports both DDE and a C API and appears to be suitable for both DOS and Windows.

    Richard Shockey tells me that the industry is likely to move towards MAPI for faxing. Apparently in a Win95/NT 4.0 environment, you can use MAPI as follows:


    MAPI diagram

    Which means "MAPI (fax) enable your application and you can fax till you drop.", as Richard puts it. For more info, mail faxinfo@microsoft.com.

    There appears to be only one public domain fax library currently available: PBFax, by John Pearson and Lance Edmonds, and it is written for PowerBASIC, which is (apparently) a very advanced DOS (compiled) programming language, featuring many of the best features of Pascal, C and Basic. PowerBASIC is very strong on comms and TSR programming, often requiring very little source code. The fax send code is for PowerBASIC 3.2 and supports class 2 and class 2.0 modems. Documentation is included. Version 10 will become shareware, with many new features. (version 8b is current; version 9 will not be released.)

    OS/2 developers might like to get in touch with Mark Ahlstrom (72120.3404@compuserve.com) of the Keller Group. Wayne Fulton tells me they produce a powerful high-end fax SDK for OS/2 that supports CAS, Class 1/2, Brooktrout and Gammalink. Their details are:

    voice phone +1 612 429 7273
    fax         +1 612 653 1987
    BBS         +1 612 653 0699
    
  10. Your final option is to write the whole thing from scratch. Obviously the viability of this option will depend on your programming ability, how much time you have, and how much your time is worth. Those who want to try this might want to have a look at GrayFax Associates' Fax Seminar which describes the fax protocol in some detail. Rockwell also offer some help for developers on the WWW including AT command set documentation. Diamond/Supra have information on class 1 and class 2 amongst other things.

Further Information

For further information you might like to check out the following:

Credits

This document was written by Alan Hart, who (although believing it to be accurate) takes no responsibility for its accuracy or otherwise. Thanks to Lance Edmonds, David Empson, Wayne Fulton, Benjoe Juliano, John B. O'Connell, Brett Macmillan, Andrew Margolis, George Pajari, Richard Shockey, and others for supplying me with information for this FAQ. If you'd like to tell me the page was useful, have any suggestions for missing links, or I haven't credited you, and you would like me to credit you, please e-mail me.

Alan


Last updated 1998-09-30, by Alan

Alan Hart's home page