# Customize header and footer with inserted pdf

I'm trying to customize header and footer while inserting a pdf using a hand-made command: \setlayout (3 parameters)

\includepdf[pagecommand={\setlayout{Left corner}{Center}{Right corner}}]{my file.pdf}


First I tried :

\documentclass[11pt,a4paper]{article}
\usepackage{pdfpages}

\newcommand{\setlayout}{3}
\thispagestyle{
}

\begin{document}
\includepdf[pages=-,pagecommand={\setlayout{Left corner}{Center}{Right corner}}]{my file.pdf}
\end{document}


But, of course, it did not work.

So I would like to create a flexible (as I am going to use it several times) \setlayout command in order to customize header and footer only where the pdf is displayed

• Welcome to TeX.SE! Please make your code snippets compilable ... – Mensch Jun 15 '17 at 19:50

Here is a suggestion using package fancyhdr to define an own style for pages included by \includepdf:

\documentclass[11pt,a4paper]{article}
\usepackage{mwe}% only for dummy text and example pdf page
\usepackage{pdfpages}
\usepackage{fancyhdr}
\pagestyle{fancy}

\fancypagestyle{pdfpages}{
\fancyhf{}
}

\newcommand{\setlayout}[3]{\thispagestyle{pdfpages}%