Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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


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.

share|improve this question
I don't believe it's possible. You'll need a tool like qpdf. –  Stephan Lehmke Jan 6 '13 at 12:30
@Stephan thank you, I'll check that. –  Haocheng Jan 6 '13 at 16:05
@StephanLehmke Please make your comment into an answer. –  Joseph Wright Aug 5 '13 at 6:22

1 Answer 1

pdfTeX, etc., cannot edit the content of PDFs: they only copy material from the source PDF files into the output PDF. As such, if you want to do more complex modifications you will need to use a third-part tool such as qpdf.

share|improve this answer
How about pdftk? Can it be used for this question? –  stalking is prohibited Sep 8 '13 at 9:22
@PSTikZ No, not in this case. The question seems to be about editing the text of a PDF, which pdftk can't do. If it's just a question of picking specific pages then you don't even need an external tool. –  Joseph Wright Sep 8 '13 at 9:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.