You can use option picturecommand of \includepdf to write arbitrary text onto each page. And of course the text could include a counter that you increment (\stepcounter) each time the text is typeset onto each page. I guess this is the most flexible way to do it:
\documentclass[a4paper]{article} \usepackage{lastpage} \usepackage{mwe} \usepackage{pdfpages} \newcounter{pdf-page} \newcommand\labeling[1]{% \put(450,800){#1-\arabic{pdf-page}}% \put(450,100){Page \arabic{page} of \pageref{LastPage}} \stepcounter{pdf-page}} \begin{document} \setcounter{pdf-page}{1} \includepdf[ pages=1-3, picturecommand={\labeling{1}}, ]{example-image-a4-numbered.pdf} \setcounter{pdf-page}{1} \includepdf[ pages=1-3, picturecommand={\labeling{PDF 2}}, ]{example-image-a4-numbered.pdf} \end{document}
Another possibility is adjusting LaTeXs header and footer with a package like fancyhdr.
\documentclass[a4paper]{article} \usepackage{lastpage} \usepackage{mwe} \usepackage{pdfpages} \usepackage{fancyhdr} \newcounter{pdfPage} \fancypagestyle{fancy}{% \fancyhf{}% \fancyhead[R]{\pdfName-\arabic{pdfPage}\stepcounter{pdfPage}}% \fancyfoot[C]{Page \arabic{page} of \pageref{LastPage}}% \renewcommand\headrulewidth{0pt}% } \pagestyle{fancy} \newcommand\pdfName{} \newcommand\pdfDocument[1]{% \renewcommand\pdfName{#1}% \setcounter{pdfPage}{1}% } \begin{document} %\newpage \pdfDocument{1} \includepdf[ pages=1-3, pagecommand={}, ]{example-image-a4-numbered.pdf} %\newpage \pdfDocument{2} \includepdf[ pages=1-3, pagecommand={}, ]{example-image-a4-numbered.pdf} \end{document}
In this example \newpage is not necessary. But as soon as you extend this example you want to take care that \pdfDocument and \includepdf are evaluated on the same page.
pagesltsused to provide support for local page numbering etc. It isn't compatible with current LaTeX, although it still works for some purposes. There is also some new functionality in LaTeX which might be usable for this. So it depends a bit on how old/recent your TeX installation is.