Header and page numbers with pdfpages

You can use the pagecommand key to declare the desired page style for the included pages:

\documentclass{book}
\usepackage[a6paper]{geometry}% just for the example
\usepackage{fancyhdr}
\usepackage{pdfpages}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{Some centered header}
\fancyfoot[C]{\thepage}

\begin{document}

\includepdf[pages=-,pagecommand={\pagestyle{fancy}}]{b}

\end{document}

The file b.tex used to produce b.pdf is:

\documentclass{book}
\usepackage[a6paper]{geometry}
\usepackage{lipsum}
\pagestyle{empty}
\begin{document}
\lipsum[1-3]
\end{document}

The resulting document, after the inclusion is (notice that the included pages have the fancy page style of the parent document):

enter image description here


I had a similar problem which was easily solved by using pagecommand but without any additional style or package. Just this way :

\chapter{Title}
Lots of multipage pdfs following
\includepdf[pages=-,frame,scale=0.9,pagecommand={}]{abc.pdf}
\includepdf[pages=-,frame,scale=0.9,pagecommand={}]{def.pdf}

to force latex to use the current page style