PBM files and WIN95
"Orlando M. Amador" (oamador@amador.org)
Tue, 27 Jul 1999 06:20:59 -0300
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01BED7F8.3232BDC0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0007_01BED7F8.323A5EE0"
------=_NextPart_001_0007_01BED7F8.323A5EE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
I used to convert the received g3 files to multipage tiff files using
"pnmtotiff". Then on the Windows machine it could be viewed with the image
viewer program. But the windows image viewer program is not usually
available on our organization.
This days my "new_fax" script convert the g3 files to pdf documents using
ghostscript. As it happens, the pdf reader is available in all of our
machines. If you decide to generate pdf documents using ghostscript, make
sure to have a recent version that support compression. I'm using Aladdin
Ghostscript 5.50. You will also need metamail in the machine if you plan to
use metasend.
Here is the new fax script we use:
#!/bin/sh
#
# new_fax script for mgetty
#
# Orlando M. Amador -- 06-23-99
#
#
# Configure this address
#
FROM_ADDRESS=faxserver
SENDTO=faxadmin
#
# This variables should not change, unlse tou use a different tmp directory.
#
TMPTEXT=/tmp/new_fax.$$.txt
TMPPS=/tmp/new_fax.$$.ps
PSINFILE=/tmp/new_fax-ps-in.$$.ps
PDFOUTFILE=/tmp/new_fax-pdf-out.$$.pdf
RESULT=$1 ; shift
ID=$1 ; shift
PAGES=$1 ; shift
PATH=$PATH:/usr/local/bin
`fax_res=`basename $1 | cut -c2`
if [ "$fax_res" = 'n' ]
then
parameters="-s"
else
parameters=
fi
#
# Prepare a PDF file of the Fax message and attach it to the message.
#
index=1
for i in "$@"
do
pagenumber=`echo $index | awk '{ printf "%04d", $1 }'`
g32pbm $parameters $i | pnmtops > $TMPPS.$pagenumber.ps
index=`expr $index + 1`
done
cat $TMPPS.*.ps > $PSINFILE
ps2pdf $PSINFILE $PDFOUTFILE
{
echo
echo
echo The attached fax was received by the fax server.
echo Current time: `date`
echo Number of pages: $PAGES
echo Fax Status: $RESULT
echo
echo
echo
} > $TMPTEXT
metasend -b -f $TMPTEXT -m text/plain -D "Text Message" \
-n -f $PDFOUTFILE -m application/pdf -D "Fax Message.pdf" \
-s "Received Fax from \"$ID\"" -t ${SENDTO} -F $FROM_ADDRESS -S
4000000
sleep 10
/bin/rm $TMPTEXT $PDFOUTFILE $TMPPS.* $PSINFILE
#
# EOS
#
-----Original Message-----
From: Pat Grogan [mailto:pgrogan@canrsg.telstra.com.au]
Sent: Monday, July 26, 1999 10:33 PM
To: mgetty@muc.de
Subject: PBM files and WIN95
After getting some help with configuring mgetty I have got incoming faxes to
be mailed to my mail address. I have used the new_fax.mail program as
provided with the mgetty distribution.
Now I am having problems reading the files on my win98 machine. I downloaded
a package called infraview32 to attempt to view the files. I get a message
"Can't read file header Unsupported file type!".
I have attached one of the files. Can someone verify that this is a valid
pbm file? Maybe mail is corrupting is during the transmission process.
I am sure that someone has used this type of facility before, do they have
any recommendation on packages to use?
Is there a better way to do this?
Any help would be appreciated.
Thanks
Pat Grogan
------=_NextPart_001_0007_01BED7F8.323A5EE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D560125308-27071999>I use=20
to convert the received g3 files to multipage tiff files using=20
"pnmtotiff". Then on the WIndows machine it could be viewed with =
the image=20
viewer program. But the windows image viewer program is not =
usually=20
avaialble on our organization.</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D560125308-27071999></SPAN></FONT> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D560125308-27071999>This=20
days my "new_fax" script convert the g3 files to pdf documents using=20
ghostscript. As it happens, the pdf reader is available in all of =
our=20
machines. If you decide to genereate pdf using ghostscript, =
make sure=20
to have a recent version that support compression. I'm using =
Aladdin=20
Ghostscript 5.50.</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D560125308-27071999></SPAN></FONT> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D560125308-27071999>Here=20
is the new fax script we use:</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D560125308-27071999></SPAN></FONT> </DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>#!/bin/sh<BR>#<BR># new_fax script for=20
mgetty<BR>#</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff size=3D2><SPAN =
class=3D560125308-27071999><BR><FONT=20
face=3D"Courier =
New">TMPTEXT=3D/tmp/new_fax.$$.txt<BR>TMPPS=3D/tmp/new_fax.$$.ps<BR>PSINF=
ILE=3D/tmp/new_fax-ps-in.$$.ps<BR>PDFOUTFILE=3D/tmp/new_fax-pdf-out.$$.pd=
f<BR>FROM_ADDRESS=3Dfaxadmin<BR>SENDTO=3Doamador</FONT></SPAN></FONT></DI=
V>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>RESULT=3D$1 ; shift<BR>ID=3D$1 ; =
shift<BR>PAGES=3D$1 ;=20
shift</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
=
class=3D560125308-27071999>PATH=3D$PATH:/usr/local/bin</SPAN></FONT></DIV=
>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff size=3D2><SPAN =
class=3D560125308-27071999><BR><FONT=20
face=3D"Courier New">fax_res=3D`basename $1 | cut -c2`<BR>if [ =
"$fax_res" =3D 'n'=20
]<BR>then<BR> =20
=
parameters=3D"-s"<BR>else<BR> =20
parameters=3D<BR>fi</FONT></SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>#<BR># Prepare a PDF file of the Fax =
message and=20
attach it to the message.<BR>#<BR>index=3D1<BR>for i in=20
"$@"<BR>do<BR> =
pagenumber=3D`echo=20
$index | awk '{ printf "%04d", $1=20
}'`<BR> g32pbm $parameters =
$i |=20
pnmtops >=20
$TMPPS.$pagenumber.ps<BR> =20
index=3D`expr $index + 1`<BR>done</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>cat $TMPPS.*.ps > $PSINFILE<BR>ps2pdf =
$PSINFILE=20
$PDFOUTFILE</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>{<BR>echo<BR>echo<BR>echo The attached fax =
was=20
received by the fax server.<BR>echo Current time: `date`<BR>echo =
Number of=20
pages: $PAGES<BR>echo Fax Status: $RESULT<BR>echo<BR>echo<BR>echo<BR>} =
>=20
$TMPTEXT</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>metasend -b -f $TMPTEXT -m text/plain -D =
"Text=20
Message" \<BR> -n -f=20
$PDFOUTFILE -m application/pdf -D "Fax Message.pdf"=20
\<BR> -s "Received Fax =
from=20
\"$ID\"" -t ${SENDTO} -F $FROM_ADDRESS -S 4000000</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>sleep 10</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>/bin/rm $TMPTEXT $PDFOUTFILE $TMPPS.*=20
$PSINFILE</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff size=3D2><SPAN=20
class=3D560125308-27071999></SPAN></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3D"Courier New" size=3D2><SPAN=20
class=3D560125308-27071999>#<BR># EOS<BR>#<BR></SPAN></FONT></DIV>
<DIV class=3DOutlookMessageHeader><FONT face=3D"Times New Roman"=20
size=3D2>-----Original Message-----<BR><B>From:</B> Pat Grogan=20
[mailto:pgrogan@canrsg.telstra.com.au]<BR><B>Sent:</B> Monday, July =
26, 1999=20
10:33 PM<BR><B>To:</B> mgetty@muc.de<BR><B>Subject:</B> PBM files and=20
WIN95<BR><BR></DIV></FONT>
<DIV><FONT face=3DArial size=3D2>After getting some help with =
configuring mgetty I=20
have got incoming faxes to be mailed to my mail address. I have used =
the=20
new_fax.mail program as provided with the mgetty distribution. =
</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Now I am having problems reading the =
files on my=20
win98 machine. I downloaded a package called infraview32 to attempt to =
view=20
the files. I get a message "Can't read file header Unsupported file=20
type!".</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I have attached one of the files. Can =
someone=20
verify that this is a valid pbm file? Maybe mail is corrupting is =
during the=20
transmission process.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I am sure that someone has used this =
type of=20
facility before, do they have any recommendation on packages to=20
use?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Is there a better way to do =
this?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Any help would be =
appreciated.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Pat Grogan</FONT></DIV>
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_001_0007_01BED7F8.323A5EE0--
------=_NextPart_000_0006_01BED7F8.3232BDC0
Content-Type: text/plain;
name="new_fax.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="new_fax.txt"
#!/bin/sh
#
# new_fax script for mgetty
#
# Orlando M. Amador -- 06-23-99
#
#
# Configure this address=20
#
FROM_ADDRESS=3Dfaxserver
SENDTO=3Dfaxadmin
#
# This variables should not change, unlse tou use a different tmp =
directory.
#
TMPTEXT=3D/tmp/new_fax.$$.txt
TMPPS=3D/tmp/new_fax.$$.ps
PSINFILE=3D/tmp/new_fax-ps-in.$$.ps
PDFOUTFILE=3D/tmp/new_fax-pdf-out.$$.pdf
RESULT=3D$1 ; shift
ID=3D$1 ; shift
PAGES=3D$1 ; shift
PATH=3D$PATH:/usr/local/bin
`fax_res=3D`basename $1 | cut -c2`
if [ "$fax_res" =3D 'n' ]
then
parameters=3D"-s"
else
parameters=3D
fi
#
# Prepare a PDF file of the Fax message and attach it to the message.
#
index=3D1
for i in "$@"
do
pagenumber=3D`echo $index | awk '{ printf "%04d", $1 }'`
g32pbm $parameters $i | pnmtops > $TMPPS.$pagenumber.ps
index=3D`expr $index + 1`
done
cat $TMPPS.*.ps > $PSINFILE
ps2pdf $PSINFILE $PDFOUTFILE
{
echo
echo
echo The attached fax was received by the fax server.
echo Current time: `date`
echo Number of pages: $PAGES
echo Fax Status: $RESULT
echo
echo
echo
} > $TMPTEXT
metasend -b -f $TMPTEXT -m text/plain -D "Text Message" \
-n -f $PDFOUTFILE -m application/pdf -D "Fax Message.pdf" \
-s "Received Fax from \"$ID\"" -t ${SENDTO} -F $FROM_ADDRESS -S =
4000000
sleep 10
/bin/rm $TMPTEXT $PDFOUTFILE $TMPPS.* $PSINFILE
#
# EOS
#
------=_NextPart_000_0006_01BED7F8.3232BDC0--