Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] Adding the cover page to the returned email..



Thanks Fricke,
I will try this out ASAP, even so I am sure you have given me enough to work
with.

Thanks again.

:)

-----Original Message-----
From: Andreas Fricke [mailto:andreas.fricke2@xxxxxxxxxxxxxxxxxxxxxxxx]
Sent: 08 November 2004 14:39
To: Olly
Subject: Re: [hylafax-users] Adding the cover page to the returned
email..


Hi Olly,

for adding the cover to the fax I wrote and changed some scripts. It's
not very elegant, but it's working :-)

*Step 1:*
Write a new script and past it "between" hfaxd and the command which is
responsible for sending a fax. This is normally defined in etc/config:
<SNIP>
SendFaxCmd:            /usr/local/bin/c2faxsend
</SNIP>

Replace this entry with the new script, i.e.
#SendFaxCmd:            /usr/local/bin/c2faxsend
SendFaxCmd:            /usr/local/bin/c2faxsend_new

The new script should contain:

# What's the name of the fax?
NOTIFY_TEMP_01="`cat $3 | grep ":docq/doc"`"
# Is there a cover?
NOTIFY_TEMP_02="`cat $3 | grep -c ".cover"`"
if [ $NOTIFY_TEMP_02 == "1" ]; then
    # NO
    PSFILE="`echo $NOTIFY_TEMP_01 | cut -d":" -f4`"
else
    # YES
    PSCOV1="`echo $NOTIFY_TEMP_01 | cut -d":" -f4`"
    PSCOV2="`echo $PSCOV1 | cut -d" " -f1`"
    PSCOVR="/var/spool/fax/$PSCOV2"
    # Make a copy of the cover with an unambiguous filename
    NOTIFY_TEMP_03="`cat $3 | grep "killtime:" | cut -d":" -f2`"
    cp /var/spool/fax/$PSCOV2
/var/spool/fax/tmp/"$NOTIFY_TEMP_03"BYc2fs_Covr.ps
fi
# Call the original faxsending - command
# $1: parameter "-m"
# $2: Device-ID
# $3: qfile

/usr/local/bin/c2faxsend "$1" "$2" "$3"
# Exit, and don't forget the status
exit $?


*Step 2:*
Modify your bin/notify:
<SNIP>
# Name of the log-file
QFILE=$1
# Is there a cover?
NOTIFY_TEMP_02="`cat $QFILE | grep -c ".cover"`"
if [ $NOTIFY_TEMP_02 == "1" ]; then
    # NO
    PSFILE="`echo $NOTIFY_TEMP_01 | cut -d":" -f4`"
else
    # YES
    NOTIFY_TEMP_01="`cat $QFILE | grep ":docq/doc"`"
    # What's the name of the fax?
    PSFILE="`echo $NOTIFY_TEMP_01 | cut -d":" -f7`"
    # Rebuild the name of the cover-page
    NOTIFY_TEMP_04="`cat $QFILE | grep "killtime:" | cut -d":" -f2`"
    PSCOVR=/var/spool/fax/tmp/"$NOTIFY_TEMP_04"BYc2fs_Covr.ps
    # Create the new fax including the cover
    cat $PSCOVR > /var/spool/fax/tmp/faxfinished.ps
    cat $PSFILE >> /var/spool/fax/tmp/faxfinished.ps
    PSFILE=/var/spool/fax/tmp/faxfinished.ps
fi
# Build the new pdf-file
/usr/bin/ps2pdf13 "$PSFILE" /var/spool/fax/tmp/faxfinished.pdf
1>/dev/null 2>/dev/null
</SNIP>

Et voilà, there's the fax including the coverpage!

I hope that's useful!

Greetings
Andreas Fricke


--
Olly schrieb:

> Hi
>
> I've managed to set up Hylafax 4.2.0 with email notification faxes, in PDF
> format, to the senders, and the Admin.
>
> So far so good.
>
> However the client is a Law firm, and they require the entire fax to be
> returned to them in the PDF. Including the customised cover page.
>
> My question:
>
> How can I add the cover page to the files that are returned in the email?
>
> Thanks.
>
> Olly
>
>
> ____________________ HylaFAX(tm) Users Mailing List
_______________________
>   To subscribe/unsubscribe, click
http://lists.hylafax.org/cgi-bin/lsg2.cgi
>  On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx <
/dev/null
>   *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*
>
>
>


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services