HylaFAX The world's most advanced open source fax server

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

[hylafax-users] [RESOLVED] Re: Repairing partially received faxes



Got this working, using Lee's suggested libtiff build and the following code in my faxrcvd script:

function convert_to_pdf() {
        local INFILE="$1"; shift
        local OUTFILE="$1"; shift

        if tiff2pdf -o "$OUTFILE" "$INFILE" "$@" >/dev/null 2>&1 ; then
                exit 0
        fi

local NUMPAGES=$(tiffinfo "$INFILE" | grep '^TIFF Directory' | wc -l)
if [ "$NUMPAGES" -le 1 ] ; then
exit 1
fi


local TEMPFILE="$(mktemp -t fixtiff.XXXXXX)"

tiffcp \
"${INFILE},$(seq 0 $(( $NUMPAGES - 2 )) | tr '[[:space:]]' ',' | sed -re 's/,$//')" \
"$TEMPFILE"
tiff2pdf -o "$OUTFILE" "$TEMPFILE" "$@"
rm -f "$TEMPFILE"
}



____________________ 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*




Project hosted by iFAX Solutions