4

I want to implement the answer here: Can I add tikzpictures to pages included with pdfpages. But I want the tikzpicture under the included pdf pages, not over it. Is there a straightforward way to set what is drawn first?

0

1 Answer 1

9

Update

As cyberSingularity mentions my original answer was wrong. I just used background package with the idea that it adds tikzpictures to background. It does it, but not when page contents is defined by pdfpages. Why?

Because pdfpages package uses eso-pic's \AddToShipoutPictureBG command to print its composition so, pdfpages result are also printed in background.

Therefore, a better solution could be to also use \AddToShipoutPictureBG command for printing our tikzpicture. Something like:

\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage{pdfpages}

\AddToShipoutPictureBG{
    \begin{tikzpicture}[remember picture,overlay]
        \node[minimum width=5cm, minimum height=5cm, font=\Huge,
              circle, draw=red, ultra thick, opacity=1, fill=pink, text=red] 
              at (current page.center) {???};
    \end{tikzpicture}
}

\begin{document}
\includepdf[pages=-,]{blind}    
\end{document}

enter image description here

Next detail shows that tikzpicture (red question marks and pink background) is behind included pdfpages as OP wanted.

enter image description here

Wrong answer

A little example with background package. There are some other packages in CTAN which can put some background to every or selected pages: watermark, wallpaper, xwatermark, ...

\documentclass[a4paper]{article}
\usepackage{background}
\usepackage{pdfpages}

\backgroundsetup{
scale=3,
angle=0,
contents={\begin{tikzpicture}[remember picture,overlay]\node[minimum width=3cm,minimum height=3cm,font=\Huge,circle,draw,ultra thick] {?};\end{tikzpicture}
  }
}

\begin{document}
\includepdf[pages=-,nup=2x2]{blind}    
\end{document}

enter image description here

2
  • @cyberSingularity You're right. I'll have to look more carefully but looks like pdfpages prints the result in background and anything else is added over it, even watermark is printed over pdfpages.
    – Ignasi
    Mar 10, 2015 at 10:48
  • @cyberSingularity I think I've found a better solution. Thank you for advertising the mistake.
    – Ignasi
    Mar 10, 2015 at 15:53

You must log in to answer this question.

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