Developer Tools


J-Fax

J-Fax is a 3rdParty accessory for Clarion, which enables programmers to easily send faxes directly from their own Clarion applications.

How does it work?

Windows 2000, XP, 2003 and Vista (except Home Edition) include a fax service object, built by Microsoft, enabling you to send faxes from programs such as MS Word, using your fax modem. J-Fax is a template for Clarion that enables you to use the same fax objects directly from your Clarion applications!

Simply add the J-Fax extension template to your APP and you will be able to fax documents using a single line of code! We have also written templates that enable you to fax your Clarion reports!! Simply add the J-Fax extension to your report and you’re ready to fax! J-Fax can add “Fax” as an option in the Report Previewer’s “File” menu (Clarion 5.5 and Clarion 6).

If you’re using the Icetips Previewer, J-Fax can also add a “Fax” button to the toolbar! And if you’re using the Clarion 6 Advanced Report Generators (ReportToPDF, ReportToXML, etc), then J-Fax can add “Fax” as another Generator option!

We currently support the following reporting tools:

  • Standard Clarion 5.5 and Clarion 6 reports.
  • Clarion 6 Advanced Report Engine.
  • Icetips Previewer
  • Fomin Report Builder
  • CPCS

But wait, there’s more…!

Microsoft’s fax objects do not let you send faxes using another computer’s fax modem, but with J-Fax you can! We have written a “Fax Server” (using Clarion) which you can run on the computer that you want to treat as the fax server (it must have a fax modem installed).

In all your “client” applications (running on other computers on the network), you simply need to tell J-Fax where the server computer is on the network, and it will automatically redirect all faxes to that “server”, which will then send out the faxes using its own modem!! This means that you only need to have one modem to send faxes for an entire network! The “client” computers don’t even need to have MS Fax installed!

Sounds great! Can I try it out?

Absolutely. You can download a compiled example showing most of the J-Fax features by clicking here.

Can I try out the client / server example?

Once you have installed the demo, you can then also download and install the server. Once you have installed the server (typically onto a different computer), you need to share the folder that the server is installed into, so that other computers can send their faxes to that folder.

Then, in the same folder where you installed the main example (the “client”), create a file using NotePad called “settings.ini”, which should look like this:

 [JFAX]
 Fax_Server=\\Gary1\Faxes

You need to change “\\Gary1\Faxes” to refer to the shared folder on your network.

Now when you run the main example (the “client”) it will automatically send all its faxes to that shared folder, where your server will then send them out! Easy as that.

User Testimonials

“I have tested J-Fax and it is truly awesome. Works great, well done! This is going to be a Big hit!” – David Swindon, South Africa

“Compiled, ran and worked first time. Lovely piece of work Gary. This is a template that has been needed for a long time. Easy to implement. Up and running in 5 minutes, including compiling!” – John Fligg, USA

“I have been looking for a product like this for over a year now!” – Terry Ho, USA

“Love what you have done with j-fax to date.” – Raymond Dummer, South Africa

“Congratulations on J-Fax, it’s a great product!” – Michael Dettmer, USA

“It’s a great product!” – Bill Wilson, South Africa

“Long time I was waiting for such a template….” – Jean-Pierre Gutsatz, France


Useful Links


Frequently Asked Questions

J-Fax

No.  The J-Fax Server program is NOT a requirement.

In other wordsIOW, you can operate J-Fax either directly from all the workstations, or you can choose to save the faxes in a common folder which the J-Fax Server program will then poll, and send the faxes from.

As an example, let’s say you have one computer which has the modem and telephone line connected to it.  You could decide to share the modem device on the machine and allow MS-Fax on other workstations to use this shared modem to send faxes.  Or, you could have your application work on a server model and save the faxes to a common folder, and have a dedicated program (J-Fax Server) service that folder.

(PS – The source code for the J-Fax Server program is included when you purchase J-Fax.)

In the event that Microsoft Fax is not installed, J-Fax will simply not work. After JFax.Init gets called, if JFax.Disabled = true, then MS Fax is not installed and J-Fax will not work. If JFax.Disabled = false, then MS Fax is installed and J-Fax will work.

One way to deal with this would be to put this code into the “Local Objects -> JFax -> MyFax -> ErrorTrap -> Before the Parent Call” embed point…

if (pMethod = ‘Init’) and (pError = ‘Microsoft Fax does not appear to be installed.’)
message(pError, ‘Error’, icon:exclamation)
end

You could test JFax.Disabled immediately after the call to JFax.Init, and could disable certain menus etc then.

If you are using the Client/Server scenario (where you have the J-Fax server EXE running on one computer and all the other computers are routing their faxes to that server) then only the “server” computer needs to have MS Fax installed. The clients using J-Fax will not need to have MS Fax installed, as J-Fax will simply generate faxes and then send them across to the server computer!

A couple of users have asked how processor intensive J-Fax is. J-Fax uses MS Fax, and J-Fax is very efficient, so the real question is “How processor hungry is MS Fax?”.

I ran some basic tests on am AMD 2400 with 512MB RAM using my J-Fax demo application. I simply faxed a couple of one page PDFs, one page TXT files, and one page DOCs, then I used Process Explorer to watch the CPU usage. The TXT files faxed without even hitting the radar, they came in at under 0.5% of CPU. DOC files used around 1.5%, and PDFs used 4.5%. When MS Fax sends a fax it actually sends the PRINT command to the registered editor application for the document type that you are faxing (so PDFs are faxed using Acrobat Reader, TXTs are faxed using NotePad, etc), and the CPU hit really seems to come from how much CPU time is required to load the default editor applications (Excel, Acrobat Reader, NotePad, etc).

The first thing to test if J-Fax is not working is whether Microsoft’s Fax Services are installed and working correctly.

The easiest way to do this is to simply open Word or NotePad, select the “File” menu, then click “Print”. Select “Fax” from the list of printers, and then try to print. If “Fax” is not listed under the printers, that indicates that the Fax Service is not installed.

To install the Fax Service, simply go to the Windows Control Panel, open Add / Remove Programs, go to Add / Remove Windows Components, and turn on the “Fax Services” option.

Something else that you can do is generate a Debug Log, and email that to us. This will give us detailed information about what J-Fax is doing, and where it may be failing.  For more information on using DebugView to generate a Debug Log see this post.

If it still doesn’t work please feel free to contact us and we will assist.

Numerous users have asked us about how they can integrate J-Fax with Icetips Previewer. If you are using Clarion 6, and have any of SoftVelocity Advanced Report Generator templates (ReportToPDF, ReportToXML, etc) then J-Fax simply plugs in as an extra option (ReportToFax). However, if you are not using the Advanced Report Generator templates you can still make use of J-Fax. Below is an outline as to how to implement J-Fax directly into the Icetips Report Previewer procedure. This tutorial assumes that you are familiar with Icetips Previewer, and already have it installed and set up in your APP.

First, add the J-Fax Global Extension template to your APP.

Then, on every Report procedure that you wish to add J-Fax functionality to, add the “J-Fax ReportToFax” procedure template, as described in the J-Fax product documentation. Set “Report Type” on that template to “Normal Clarion Report”.

On your Icetips Report Previewer procedure, add the “J-Fax IcetipsPreviewer Support” extension template.

Lastly, on your Icetips Report Previewer procedure, add a new menu item to the “File” menu, and call it something like “Fax Report”. Behind that menu item, simply embed the following code…

Do FaxReport

That’s all there is to it.

Lastly, you might want to add the following code into the Icetips Previewer’s “Window Events”, “Open Window”, after “Generated Code” embed point..

if MyFax.Disabled = true
disable(?FileFax)
end

Assuming your “Fax” item in the “File” is “?FileFax”, then this code will disable that menu item if MS Fax is not installed. J-Fax will do this automatically for standard Clarion reports, but you need to do it manually for the Icetips Previewer.

Yes it does. We have included an example application showing how to do this. You can find this example in your Clarion\3rdParty\Examples\JFax folder.

You can easily send a cover page with your faxes. First you need a cover page file (*.cov) to use as the cover page “template” if you like. You can design your own cover page file using Microsoft’s “Cover Page Editor” program. In Windows XP this can be found at “Start -> All Programs -> Accessories -> Communications -> Fax -> Fax Cover Page Editor”. We have included a simple cover page file called jfax.cov with all the J-Fax example applications.

Once you have your cover page file ready (assuming it’s called “jfax.cov”), you can implement the cover page as follows…

MyFax.SendCoverpage=true
MyFax.CoverpageName = 'c:\jfax.cov'
MyFax.CoverpageSubject = 'Hello Fred'
MyFax.CoverpageNote = 'Here are the pages you asked for.'
MyFax.SendFax ('0800123456', 'c:\myfax.txt')

The most common scenario when it comes to faxing within a company is that one computer will have a working fax modem, and will be designated as the “fax server”. J-Fax makes it very easy to implement client / server architecture, simply follow these steps…

1. In your Clarion\3rdParty\Examples\JFax\Server directory, you will find an example APP called “jfaxsvr.app”. This APP will compile to an EXE, which you will then run on the server. Compile the APP, and copy it to a shared folder on your server, for example \\Server1\Public\MyFaxes. That shared folder is crucial, so take careful note of where yours is, and make sure that the clients who will be faxing “to” or “via” this fax server have sufficient access to that folder so that they can copy files to it. A compiled version of this example can also be downloaded (for free) directly from this link.

2. Along with the compiled EXE (point 1, above), you also need to copy JFaxHelper.dll and pwutil.dll into the same folder that the server EXE is running from. Because the EXE is compiled in local mode, you do not need to copy any of the Clarion runtime DLLs.

3. In your own APP (where you will be faxing from), if you have a look at the J-Fax Global Extension Template settings, select the tab called “General”. You will notice a section called “Fax Server Path”. You can either set the fax server path using a variable, or using an INI file. Your fax server path needs to point to a shared folder on another computer where J-Fax Server is running. This could be something like this…

\\server1\public\myfaxes

If you do not set the server path (using either the variable or the INI file settings above), then J-Fax will attempt to fax via the local fax modem. However, by simply setting the server path (as described above), J-Fax will then redirect all faxes to the shared folder on the server. The EXE that you compiled in step 1 (above) needs to be running in that shared folder, and it will then periodically check for any new documents (faxes), and if it finds any it will fax them out, using its own local fax modem.

This information is published on the Developer Tools page.


Clarion

From Windows Vista, you may experience problems running certain Clarion accessory installers, whereby they will not be able to detect your installed versions of Clarion.  Please see the following link for more information, as well as a workaround:

http://www.lindersoft.com/forums/showthread.php?t=18582

If you are experiencing problems compiling our example applications using Clarion 5.5.h, please take a look at the following article:

http://www.capesoft.com/accessories/c55a.htm

DebugView is a free application that you can download from Microsoft, which enables you to view debug output from our products. This can be very helpful in tracking down problems.

By default, our products do not generate debug messages, so you will not see anything in DebugView. To enable debug messages, simpy tick the “Send messages to DebugView” option found on each of products’ Global Extension Templates, as shown below.

Once you have turned on the “Send messages to DebugView” option, recompile and run your APP. You should then see messages appearing in DebugView.

Our 3rdParty documentation is now available from within the Clarion 7 IDE.

After installing any of our Clarion 3rdParty products, you can now access our help system as follows…

From within the Clarion 7 IDE, simply click on the “Help” menu, then click on “Accessory”, then “StrategyOnline”.  Then click on “Online Product Documentation”.