HylaFAX The world's most advanced open source fax server

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

Re: [hylafax-users] Somewhat OT: Need to overlay data onto form prior to faxing



On Mon, Aug 16, 2004 at 03:22:28PM -0400, Jim Moseby wrote:
> 
> 
> Yes, I think.  An example: I have a blank invoice form in postscript format,
> and an ascii file with 40 pages of invoices.  I want to fax these 40
> invoices to a single destination, and so I convert the 40 page ascii file to
> a 40 page postscript file, "watermarking" each page with the blank form, in
> essence "overlaying" the data onto 40 blank forms.
> 

We did something very similar with our invoice:

1. create a blank invoice form in postscript
2. convert 40 page ascii file into 40 individual postscript file
3. watermark the form onto each postscript invoice page
4. combine the postscript files back together into one big one for
printing/faxing.

The 'wartermarking' is done in #3, using this simple little perl script:

-------------

#!/usr/bin/perl

open(DOD, "$ARGV[1]");
$flag = 0;
while (<DOD>) {
    if (/^%%Page:/) {
        if ($flag) {
            print "grestore\n";
        }
        $flag = 1;
        print $_;
        print "gsave\n";
        #print ".99 setgray\n";

        &watermark();

        print "grestore\n";
    } else {
        print;
    }
}
close(DOD);

sub watermark {

  open (RPT, "$ARGV[0]");
  while (<RPT>) {
    print $_;
  }
  close (RPT);
}


---------------------------

It's some basic simple postscript search and replace...

-- 
Yifang Dai		 |
eFax: (847)628-0255      |    Debian GNU/Linux
yifang_dai@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*




Project hosted by iFAX Solutions