#!/usr/local/bin/perl
# Add the current date to a PS file.
# Author: "Christophe Declercq" <cdeclercq@nordnet.fr>
$flag =3D 0;
@date=3Dlocaltime(time);
($day,$month,$year)=3D@date[3,4,5];
$month++;
$year+=3D1900;
while (<>) {
    if (/^%%Page:/) {
        if ($flag) {
            print "grestore\n";
        }
        $flag =3D 1;
        print $_;
        print "gsave\n";
	print "/Times-Roman-Italic findfont 12 scalefont setfont\n";
	print "60 60 moveto\n";
	print "(Printed on $day/$month/$year) show\n";
        print "grestore\n";
    } else {
        print;
    }
}
