You can try pdftk, but it works only a fraction of the time, due to (I believe) a problem with fonts.
It works like this: first you need to uncompress the pdf file,
pdftk myfile.pdf output unc.pdf uncompress
then you modify it with
sed 's/oldstring/newstring/g' < unc.pdf > mod_unc.pdf
lastly you recompress it with
pdftk mod_unc.pdf output myfile_modified.pdf compress
I have had only moderate success with this command, in the sense that sometimes it works, sometimes it doesn't, according to its whim.