Adjusting scale for printing faxes / Solved

Erik van der Meulen (erik@avondel.xs4all.nl)
Fri, 13 Nov 1998 23:00:12 +0100


> Dear people,
> 
> I am running a new Debian 2.0 Linux system that has mgetty-fax 1.1.14-2
> installed. Receiving faxes works flawlessly, and I am very pleased with
> that indeed.
> Now I have set up the post process scripts called new-fax by Darko Krizic
> which came with my distribution. They provide very nice options for
> dealing with faxes. The only thing which I can not seem to solve is that
> if a normal resolution fax is printed, it comes out compressed to half
> the height of a page. Very difficult indeed. High res. faxes work very
> well.

Hi, because I did not receive any response at all to the above query,
I have started some experimenting myself. It turned out to be not as
hard as feared. Just in case someone is interested, the code below
adjusts for normal-res faxes, based on the file name:

{
        # optionally take data as new archive directory
        if [ ! -z "$data" ]
        then
                printer=$data
        fi
        for file in $*
        do
                res=`basename $file | cut -c4`
                if [ "$res" = "n" ]
                then
                        stretch="-s"
                else
                        stretch=""
                fi

                log "print $file to $printer"
                g32pbm $stretch $file \
                | pnmscale -xysize 2479 3508 \
                | pgmtopbm -fs \
                | pbmtolj -resolution 300 \
                | lpr -P $printer
        done
}

Regards,

Erik van der Meulen
<erik@avondel.xs4all.nl>