4

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?

1 Answer 1

6

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}
1
  • 6
    So the fix consists in adding the option pages=- to \includepdf. A little more verbosity is usually helpful.
    – Speravir
    Commented Sep 25, 2012 at 3:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .