[Tex/LaTex] Include several pages of a PDF without losing LaTex document style

pdfpages

I would like to include several pages of a PDF as a subsection in my LaTex Document using the package pdfpages. I tried

\includepdf[scale=0.8,pages=1-5,pagecommand=\subsection{blub}]{testpdf}

from the question How to include PDF pages without a newpage before the first page?
But unfortunately every single page of the pdf becomes a new subsection though I would like to have just one subsection with five pages. The default setting
\includepdf[scale=0.8,pages={1-5}]{pdfdocument}
for pagecommand does not work for me either, because I want the normal page numbers, headseplines and so on to appear. I have no idea which option for pagecommand I could use to make this work. Thanks a lot for your help!

Best Answer

The default pagecommand uses \thispagestyle{empty} which disables page numbers, headers and footers etc. You can use pagecommand={} to overwrite this and get normal layout for these pages.