pdftk old.pdf output new.pdf uncompress perl -pi -e 's/oldstring/newstring/g' new.pdf #### pdftk new.pdf output new_compress.pdf compress