14

I would like to decorate pages of some pdf documents with tikzpictures. My idea was to include them with pdfpages, and then draw a tikzpicture overlay on top of the page.

\documentclass[12pt]{article}

\usepackage{pdfpages}
\usepackage{tikz}
\begin{document}

\includepdf[pages=1]{someinputpdf}
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {test};
\end{tikzpicture}

\end{document}

However, tikzpicture ends up at page 2 of the resulting document. Is there a way to achieve similar functionality?

23

You could use the pagecommand option, such as

\includepdf[pagecommand={\begin{tikzpicture}...\end{tikzpicture}}]{filename}
  • Very nice. Can this option be set globally for all \includepdf calls? – Martin Scharrer Mar 7 '11 at 10:32
  • 2
    To answer my own question: \setkeys{pdfpages}{<options>} makes the options global, like with graphicx. – Martin Scharrer Mar 7 '11 at 10:48

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.