(Would have left as a comment to the updf answer, but stackexchange's policy on "karma" prevents me commenting, but does not prevent me leaving an answer).
updf is really good for this. Having used preview on MacOS to "sign" documents, updf offers the closest user experience to this.
The following works on Ubuntu 14.10 and Debian 8.
I didn't want to add a third party ppa to my system, so got updf running in the following way instead:
$ bzr branch lp:updf
then made the 2 line edit as referenced from the other answer.
# apt-get install python-poppler gir1.2-gtk-3.0 gir1.2-gdkpixbuf-2.0 gir1.2-poppler-0.18 python-cairo librsvg2-2 gir1.2-rsvg-2.0 python-gi-cairo
(the above was sufficient; not every package may be necessary, though).
and then the python program is runnable in-place:
Unfortunately, quality can be severely affected in the output document compared to the input document. The right way to do this would be to overlay the signature, and not change the original, in a lossless process. Whereas updf appears to engage in re-encoding of the original.