Place calls with a fax modem

695 Views Asked by At

I'd like to develop an application capable of placing calls using a FAX Modem. Since I am a java programmer, I'd like to do it using Java or maybe JNA.

I found some documentation about Windows TAPI api but I don't know any C++ and Window programming is quite hard to learn.

1

There are 1 best solutions below

1
On

If you want to send/receive faxes, see RFax here: http://www.java4less.com/RFax_help.html

It looks really simple to use. The following few lines of code is enough, for instace, for sending fax:

// create fax producer 
producer p=new faxTextProducer(); 
p.text=this.txt.getText("Hello, \n\n this is a fax sent with RFax\n\nregards\n\nJ4L"); 
p.pageImage=new BufferedImage(800,1290,BufferedImage.INT_RGB); 
p.prepare();

  // setup modem 
 faxModem m=new faxModem(); 
 m.setPortName("COM1"); 
 m.faxClass=1;

 m.open(p); // send 
if (m.sendFax("123456789")) System.out.println("Success ***"); 
else System.out.println("Failure: " + m.lastError);

m.close();