Hylafax Mailing List Archives

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

Re: [hylafax-users] add headers to received fax



--- Chris Parsons <chrisp@infotec.com.au> wrote:
> 
> I struggled at this one but not for long. Its been
> popular, I had a few
> requests for it.
> Add the attached file to your /usr/bin directory.
> add this line to your faxrcvd script:
> 
> 
> /usr/bin/tiff2ps -pa1 $FILE | /usr/bin/faxprint.pl
> $FILE | lpr
> 
> and along the bottom of each fax you will get a line
> that says:
> 
> recvq/Filename     Page 1 of 5
> 
> It doesnt do date & time, but have a look at
> faxprint.pl and you should see
> how it 
> does what it does so modify it as you see fit.
> If you have too many problems email me and I should
> be able to adjust it for
> you.
> Hope it helps...

Chris and Perl rulez....:-))

It's working. I changed a few things myself, yeah,
uunbelievable!!!, I never programmed in Perl, not even
a line, what saves me it's my background in TCL.
Anyway, this is what I did:

#!/usr/bin/perl


# faxprint.pl
# Written By Chris Parsons 2002
# Infotec Communications
# Prints the filename and pagenumber at the bottom of
each page.
# Written for hylfax...... 4.1.1 requires faxinfo.


# Reads a ps file from stdin and appends (filename    
Page: x of numpages)
# to the bottom of each page in Times Roman 15 point
font.
# the filename is to be provided as the argument for
this program.




$flag = 0;
#Use this to handle pages.
$SEQUENCE = 1;

$faxfile = @ARGV[0];
$OUTPUT = `/usr/sbin/faxinfo $faxfile`;
#print $OUTPUT;
($crap,$sender,$pages,$quality,$page,$received,$rest)=split(/\n/,$OUTPUT);
($crap,$receive)=split(/:/,$received);



while (<STDIN>) {
    if (/^showpage/) {
        print "/Times-Roman findfont\n";
        print "12 scalefont\n";
        print "setfont\n";
        print "newpath\n";

#       Uncomment Below to Print at top of page.
        print "18 828 moveto\n";
        print "($faxfile     $received) show\n";

#       Uncomment Below to Print at bottom of page.
#       print "newpath\n";
#       print "18 18 moveto\n";
#       print "($faxfile     $received) show\n";
        print "showpage\n";

    } else {
        print;
    }
}

P.S. Don't teasing me about the changes:-))).

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

____________________ 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@hylafax.org < /dev/null



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