Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

faxing programmatically

  Asked By: Egidius    Date: Jun 05    Category: Java    Views: 1170
  

we need a faxing program via java application ;
we have to send doc & pdf and database jasper generated reports by fax ;
and couldn't find right way to do ;
can you recommend me some solution ?

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Adalwen Fischer     Answered On: Jun 05

First, I am sorry if this is not exactly what you want and you rather
look for some plugin for your content-generation library and see it as a
consumer who wants the automatic settlement of the transaction.

But if you look for faxing solutions with java, you have different ways
to take this, of which the following 3 might make sense to you:

1. small scale: when you have the ATI commands to fax, get your hands on
java comm api and write your code against the fax-modem peripheral cards
or buy packages like http://www.java4less.com/java_fax.htm

2. build a queued fax server: use http://alpha.greenie.net/mgetty/ on a
linux box and some scripts as a backend fax server for your system and
develop your software to feel the queue and monitor your server (JMX or
whatever communication model you want on your java  side but the
interface to the fax server will be rather easier with a file-based
interface (polling))

3. Full scale PBX box: run an installtion of http://www.asterisk.org/
with add-ons for faxing in place (this might be an over kill as it is
not only for fax: you might run your callcenter on it)

NOTE: Using JTAPI implmenetations (e.g. j323 engnine of IBM) seems
elegant but i am not aware of any current JTAPI implementation that
implements the fax part as well.

I think you are better off with 1 (or its alternatives), or 2 (or its
alternatives), based on the usecase you got. write back if you have
further questions.

 
Answer #2    Answered By: Dylan Evans     Answered On: Jun 05

If you decided to use the 1st solution, you should get javax.comm package and RXTX program  (This is a serial port driver for linux), then do some configurations that are described at www.rxtx.org.
If you decided to use the 2nd solution, the bash script function below converts your .pdf files to some .g3 fax pages which can be sent by mgetty.


convert()
{
# Converts a pdf  file to g3 files
if [ $# -lt 1 ]
then
return 1
fi
pdfname=$1
bnm=`basename $pdfname .pdf`
gs -r204x196 -dNOPAUSE -dBATCH -sDEVICE=tiffg3 -sOutputFile=${bnm}.tif $pdfname
tiffsplit $bnm.tif _$bnm
rm -f $bnm.tif
for i in _${bnm}*tif
do
echo "tiff file : " $i
j=`basename $i .tif`
tiff2ps $i > $j.ps
gs -r204x196 -dNOPAUSE -dBATCH -sDEVICE=pbm -sOutputFile=$j.pbm $j.ps
pbm2g3 $j.pbm > $j.g3
rm -f $j.tif $j.ps $j.pbm
done
return 0
}

 
Answer #3    Answered By: Kerry Wright     Answered On: Jun 05

I have been used your second solution  (standalone service by java4less)
but i have very much problems to run and use it;

1) initializing modem by AT&T flow control command is very difficult because these commands are not easily known for any common kind of modems especially for our end users ;


2) sending and receiving fax by this package is possible for pure text and not for any documents types such pdf  or doc  extensions or images ;


please give me more explanations about this product or suggest me another standalone fax services in java.

 
Answer #4    Answered By: Miriam Green     Answered On: Jun 05

I have been used your second solution  (standalone service by java4less )

You mean suggestion one.
but i have very much problems to run and use it;

1) initializing modem by AT&T flow control command is very difficult because these commands are not easily known for any common kind of modems especially for our end users ;
I told you if you have the commands for your card.


2) sending and receiving fax by this package is possible for pure text and not for any documents types such pdf  or doc  extensions or images ;
Read the FAQ on their website about pdfs. For rendering of docs and generating the fax immage I suppose you should take the doc to pdf and then pdf to fax solutions.



please give me more explanations about this product or suggest me another standalone fax services in java  ;

Read the FAQ and documentations of both this product and Javacomm and get sure you cover your usecase before you design. Hacking is very good to get a feeeling about the time you will need for a full integration, but you need to know what are the possibliites some packge offer you and what you want to do before you rush into it.

 
Didn't find what you were looking for? Find more on faxing programmatically Or get search suggestion and latest updates.




Tagged: