I had not seriously used qpdf in quite a while. It has many more options than it did even four years ago, including an underlay option that works perfectly for this. So you can also use qpdf--in fact, it's simpler. Ignoring the commands to clean up temporary files:
Code:
k2pdfopt -mode copy -dpi 300 -ocr t -ocrd p src.pdf -o temp1.pdf
k2pdfopt -mode copy -dpi 50 -bpc 1 -g 100 -cmax -100 -s- temp1.pdf -o temp2.pdf
qpdf src.pdf --underlay temp2.pdf -- out.pdf
I bumped up the dpi in the throw-away file to 50 to improve the placement of the text layer.