In BBj 10.0 and higher, the BASIS Fax Utility allows users to fax PDF files from a local system that is connected to a fax modem on a COM port. In addition, users can extend the BASIS Fax Utility to handle other types of files or data.
The Fax Utility resides in the directory <bbj_install>/utils/fax and contains a sample program in PDFFaxExample.src as well as three BBj custom classes in LocalFax.src.
Running the Example Program
Invoke the sample program PDFFaxExample.src as follows:
bbj PDFFaxExample.src <absolute path to pdf file> <phone number>
This sample program uses the fax modem of the local machine to fax the PDF file to a specified phone number. The sample program is an example of using the PDFFaxJob class in BBj programs. Uses for integrating the ability to fax in BBj programs include sending quotes or other documents to clients who request that a hard fax be sent.
The Custom Objects
The BASIS Fax Utility consists of two objects and an interface: PDFFaxJob is intended for immediate use, while FaxJob and FaxJobBase are provided for users to extend for their own needs.
- PDFFaxJob faxes PDF documents
- FaxJob is an interface that specifies a set of methods that every fax job must implement
- FaxJobBase is a base class that provides default functionality, including maintaining lists of phone numbers and documents related to a single fax job. One can extend FaxJobBase to create a custom fax job
The BASIS Fax Utility uses a third-party library from Java4Less called RFax. Any faxes sent will include a banner stating that the RFax library is being used until the customer obtains a license from Java4Less here.