3

This is related to the post How can I superimpose LaTeX / TeX output over a PDF file?.

One of the answers is (which is the one I'm using now):

\documentclass[12pt]{article}
\usepackage{pdfpages}
\usepackage{tikz}
\begin{document}
\includepdf[pagecommand={\begin{tikzpicture}[remember picture, overlay]\node at (current page.center) {overlayed text};\end{tikzpicture}}]{filename}
\end{document}

I modified is to use absolute position:

\documentclass[12pt]{article}
\usepackage{pdfpages}
\usepackage{tikz}
\begin{document}
\includepdf[pagecommand={\begin{tikzpicture}[remember picture, overlay]\node at (0.5, 1) {overlayed text};\end{tikzpicture}}]{filename}
\end{document}

However when I tried it on a pdf document with multiple pages, only the first page of the pdf document is extracted and used for the creation of the new pdf document. The text is included the new pdf correctly.

Question: How do I make sure that the text is included on every page?

5

Easy fix:

\documentclass[12pt]{article}
\usepackage{pdfpages}
\usepackage{tikz}
\begin{document}
  \includepdf[pages=-,pagecommand={\begin{tikzpicture}[remember picture, overlay]
      \node at (0.5, 1) {overlayed text};
    \end{tikzpicture}}]{filename}
\end{document}
  • 6
    So the fix consists in adding the option pages=- to \includepdf. A little more verbosity is usually helpful. – Speravir Sep 25 '12 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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