For people that do not want to install a texlive distribution, you may prefer this solution (you need to install enscript, ps2pdf and pdftk):
echo "I will be stamped on top of the page" | enscript -B -f Courier-Bold16 -o- | ps2pdf - | pdftk input.pdf stamp - output output.pdf