I know how to include pdf pages using package pdfpages and do it all the time, but always had problem with getting the page centered and scaling. 

I am now trying to learn how to use tikzpicture to do the same, since I'd like to take advantage of overlay option, as in

```
\begin{tikzpicture}[remember picture,overlay]

```

Which I found, on a single page, works well. The problem is that I have to use a loop, since when using `\includegraphics[page=??]{file2.pdf}` the `page` number has to be a single page. I can't use something as `\includepdf[page={2-}]` for example, to tell it to read pages 2 to the end of the pdf file. 

Here is a MWE to read one page in tickz which works fine:

```
\documentclass[11pt]{report}
\usepackage{amsmath,mathtools}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{tikz}
\usepackage{pgffor}

\begin{document}
\begin{tikzpicture}[remember picture,overlay]   
     \node[inner sep=0pt] at (current page.center)
         {\includegraphics[page=1]{file2.pdf}};
\end{tikzpicture}
\end{document}

```

Now, I wanted to do the same, but not just for page 1, but for all the pages. This is what I tried

```
\documentclass[11pt]{report}    
\usepackage{amsmath,mathtools}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{tikz}
\usepackage{pgffor}

\begin{document}    
\pdfximage{file2.pdf}  %find how many pages 
There are \the\pdflastximagepages\ pages in the file. Now 
we will include them:

\begin{tikzpicture}[remember picture,overlay]   
   \foreach \index in {1, ... ,\the\pdflastximagepages}
   {
     \node[inner sep=0pt] at (current page.center)
         {\includegraphics[page=\index]{file2.pdf}};
   }
\end{tikzpicture}    
\end{document}

```

But this gives error `Paragraph ended before \pgffor@dots@stripcontext was complete.`

I also tried to put the loop outside, and the tikzpicture inside

```
\documentclass[11pt]{report}    
\usepackage{amsmath,mathtools}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{tikz}
\usepackage{pgffor}

\begin{document}    
\pdfximage{file2.pdf}

\foreach \index in {1, ... ,\the\pdflastximagepages}
{
   \begin{tikzpicture}[remember picture,overlay]   
      \node[inner sep=0pt] at (current page.center)
         {\includegraphics[page=\index]{file2.pdf}};
   \end{tikzpicture}
}
\end{document}

```

Same problem. Clearly I am lost and do not know what I am doing so I am asking experts help in getting the syntax right.

references:

["For loop" in newcommand](https://tex.stackexchange.com/questions/20341/for-loop-in-newcommand)

[Including a PDF page in latex with pdfpages without scaling](https://tex.stackexchange.com/questions/19383/including-a-pdf-page-in-latex-with-pdfpages-without-scaling)