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
}