# How to substitute some text in a existing PDF file while using includepdf

I have a existing PDF, and it is included into my document through \includepdf in package pdfpages, and I'm curious that can some text in the PDF file be substituted by some else?

For example, I have foo.pdf with contents

foo foo1 foo2

and it's included in bar.tex

\usepackage{pdfpages}
\begin{document}
\includepdf{foo.pdf}
\end{document}

Can I add some directives in bar.tex, substituting foo1 in foo.pdf with bar1, making bar.pdf like this

foo bar1 foo2

As I know, package PSfrag can edit text in EPS file.

-
I don't believe it's possible. You'll need a tool like qpdf. –  Stephan Lehmke Jan 6 at 12:30
@Stephan thank you, I'll check that. –  Haocheng Jan 6 at 16:05