Skip to content

sagiegurari/fax4j

Repository files navigation

fax4j

Maven Version CI License

Java fax library.

Introduction

The fax4j is a Java fax library.
This library enables Java applications to invoke fax actions such as submitting fax jobs.
You can get the latest version from here - pick the fax4j-[version number]-full.zip to get the binary distribution with all dependencies and documents.

Or if you are using maven, simply add the following to your pom.xml:

<dependency>
  <groupId>net.sf.fax4j</groupId>
  <artifactId>fax4j</artifactId>
  <version>0.45.0</version>
</dependency>

Features

The fax4j provides a standard and consistent faxing API to enable invoking the different fax actions from Java applications.
The fax4j library enables to integrate with fax services via many different SPI (service provider interface) implementations.
Currently fax4j supports the following implementations:

  • Windows native fax API (requires windows fax/tapi component installed)
  • Windows COM fax API (via VBS called from the Java layer, requires windows fax/tapi component installed)
  • Email (via email servers that enable to send fax message based on incoming email messages) including built-in support for many of the leading vendors.
  • HTTP
  • External Processes
  • Linux native fax API (requires linux efax utility)
  • Mac native fax API
  • HylaFax (via gnu-hylafax library)

And more...

In addition the fax4j library also provides the fax bridge API which is a context specific faxing API.
The fax bridge enables to transform emails servers, web servers and more into an online fax service.
The x2fax sub project provides a set of standalone servers and deployable components which enable to provide x2fax services out of the box.
The x2fax contains built-in email component to enhance email servers to provide email2fax services and HTTP servers and WARs to convert any Java web server into a web2fax bridge.

Example Usage

//get new instance of a fax client (based on internal + external fax4j.properties file data)
FaxClient faxClient=FaxClientFactory.createFaxClient();

//create a new fax job
FaxJob faxJob=faxClient.createFaxJob();

//set fax job values
faxJob.setFile(new File("./my_document.txt"));
faxJob.setPriority(FaxJobPriority.HIGH_PRIORITY);
faxJob.setTargetAddress("555-555");
faxJob.setTargetName("YourName");
faxJob.setSenderEmail("[email protected]");
faxJob.setSenderName("MyName");

//submit fax job
faxClient.submitFaxJob(faxJob);

//print submitted fax job ID (may not be supported by all SPIs)
System.out.println("Fax job submitted, ID: "+faxJob.getID());

You can see more examples and a tutorial at: javadocs

Building from Sources

The fax4j library comes with a maven pom.xml which can be used to build the Java layer of the library.
On windows, the fax4j.dll will also be built, therefore the path for the msbuild.exe (in the .NET installation) must be set.
While this library supports java 1.5 and up, the build process of this library (not of depended libraries) require java 5/6.
However building this library from source is not required as it provide many extension capabilities via configuration.

Help Needed

At this time, I have limited ability to fully test this library and only tests that are running in the appveyor build are validating the library to ensure it is working properly.

While at the past I would run additional local tests, I have no such capability at the moment, so I'll be very happy to get any feedback that the library still works for every new release and on what platform it was tested.

Road Map

This project started at 2009 and was hosted originally on sourceforge (This is also the reason why the groupId starts with net.sf).

Currently this library is in maintenance mode and no future development is currently being planned.

However, any PR will be reviewed and merged if it passes all validations.

For historical forum posts which are not in github please see the original sourceforge project discussion page.

License

The fax4j library is distributed under the "The Apache Software License, Version 2.0" license which means that it is possible to distribute this library also in commercial closed source products.

Change Log

See Change Log for full report.