When printing PDF documents it can often be useful to add a few quick notes to the document to help you remember context on the day you chose to print it. This is especially true as a reviewer of academic papers, where a submitted paper needs to be identified as such, with its ID number from the reviewing system, etc.
I recently discovered the pdfpages LaTeX package, which enables the \includepdf command to include an arbitrary selection of pages from an existing PDF into the resulting PDF. This makes it possible to throw together a .tex document in less than 10 lines that can do exactly what I want.
I went ahead and scripted this using python, available here:
https://github.com/jonmccune/annotate-pdf-hf
Usage:
$ ./annotate-pdf-hf.py -h
usage: annotate-pdf-hf.py [-h] -i INFILE [-l LHEAD] [-c CHEAD] [-r RHEAD]
[-f LFOOT] [-o RFOOT]
Magic header/footer annotation inserter
optional arguments:
-h, --help show this help message and exit
-i INFILE, --infile INFILE
Input PDF File
-l LHEAD, --lhead LHEAD
Left Header
-c CHEAD, --chead CHEAD
Center Header
-r RHEAD, --rhead RHEAD
Right Header
-f LFOOT, --lfoot LFOOT
Left Footer
-o RFOOT, --rfoot RFOOT
Right Footer