# include multi-page pdf with header and footer

I want to publish the authors version of scientific research papers with additional copyright annotations. I have a multi-page pdf file paper.pdf which was created using the IEEEtran template for IEEE proceedings. Now I want to add a a header box and a footer box above and below the included pdf, using the white space for additional legal information. I ended up with the following code:

\documentclass[12pt]{scrartcl}
\renewcommand{\familydefault}{cmss}
\usepackage{pdfpages}
\begin{document}
\centering
\vspace*{-2cm}
\fboxrule=0.4pt \fboxsep=3pt
This is the author's version of an article that has been published in the ICMA 2020 proceedings.\\
Changes were made to this version by the publisher prior to publication. \\
The final version of record is available at http://dx.doi.org/10.1109/ICMA49215.2020.9233709
\end{minipage}}
\fbox{\begin{minipage}{1.05\linewidth} % footer box
Copyright (c) 2020 IEEE. Personal use is permitted. For any other purposes, permission must be obtained from the IEEE by emailing pubs-permissions@ieee.org.
\end{minipage}}
}
\end{document}


Using \thispagestyle{empty} is for removing the page numbers. The header box is placed as I want. But I can not bring the footer box below the included pdf. Using vspace between the minipages was not successful and adding an additional empty minipage was neither. I can separate the boxes, but not enough, or I can bring the footer box to the next page. I guess I am missing something basic here.

Defining a new page style as shown in other posts is definitely a good idea. Another possible and very flexible way is to use option picturecommand:

\includepdf[
pages=-,
picturecommand={%
\put(50,800){top: lorem ipsum}%
\put(50,100){bottom: lorem ipsum}}
]{dummy.pdf}

• fancyhdr, scrlayer and picturecommand all work well, but I would take this as a solution, since the tex code is the most simple. Thanks. I used picturecommand={\put(50,790){\headernote}\put(50,70){\footernote}} Jan 31 '21 at 9:32

Using fancyhdr and enlarging the size of the pages will do the trick. (from letter to A4).

scale=0.98 downsizes the source a little (needs graphicx).

offset=8pt -20pt helps to center it on the page.

You can play around with these setting, and also withtop and bottom to find a layout of your liking.

\documentclass[12pt, a4paper]{article}
\usepackage[top=1.5in, left=0.8in, right=1in, bottom=0.9in]{geometry} % added

% letter 8.5x11.0 in
% A4 8.3x11.7 in

\renewcommand{\familydefault}{cmss}
\usepackage{pdfpages}

\fancyfoot{}
\fancyfoot[C]{\footernote}
\renewcommand{\footrulewidth}{0pt}

\begin{document}

\vspace*{-2cm}
\fboxrule=0.4pt \fboxsep=3pt \fbox{\begin{minipage}{1.05\linewidth} % header box
This is the author's version of an article that has been published in the ICMA 2020  proceedings.\\
Changes were made to this version by the publisher prior to publication. \\
The final version of record is available at http://dx.doi.org/10.1109/ICMA49215.2020.9233709
\end{minipage}}
}

\newcommand{\footernote}{%
\fboxrule=0.4pt \fboxsep=3pt\fbox{\begin{minipage}{1.05\linewidth} % footer box
\centering
Copyright (c) 2020 IEEE. Personal use is permitted. For any other purposes, permission must be obtained from the IEEE by emailing pubs-permissions@ieee.org.
\end{minipage}}
}
\includepdf[pages=-,pagecommand={\thispagestyle{fancy}},scale=0.98,offset=8pt -20pt]{IEEEtran_HOWTO.pdf}
\end{document}


As source I used the file IEEEtran_HOWTO.pdf which is part of ieetran distribution. It has a 8.5 x 11.0 in (letter) page size.

You could load package scrlayer (part of the KOMA-Script bundle) and declare a new layer page style:

\documentclass[12pt]{scrartcl}
\renewcommand{\familydefault}{cmss}
\usepackage{pdfpages}

\usepackage{scrlayer}

\DeclareNewLayer[
background,
width=1.12\textwidth,% maximal width

\DeclareNewLayer[
background,
foot,
contents=\footernote
]{footerbox}
\newcommand\footernote{}

\setlength{\fboxrule}{0.4pt}%
\setlength{\fboxsep}{3pt}%
\centering
\fbox{\begin{minipage}{#1}#2\end{minipage}}%
}

\begin{document}