答案1
您可以加载包scrlayer-scrpage
并为页面顶部和底部的图片声明额外的图层。然后可以将这些图层添加到所有页面样式中。
\documentclass[a4paper]{article}
\usepackage[
hmargin=2cm,
vmargin=4cm,
headsep=1em,% adjust the vertical position of the header entry (e.g. section)
footskip=2em% adjust the vertical position of the footer entry (e.g. page number)
]{geometry}
\usepackage{graphicx}
\usepackage[
automark,% if you want to use section entries in the header/footer
headwidth=paper,% if the header entries should also use the whole page width
footwidth=head
]{scrlayer-scrpage}
\DeclareNewLayer[
background,
topmargin,
mode=picture,
contents=\putUL{\raisebox{-\height}{\includegraphics[width=\layerwidth,height=2.5cm]{example-image-A}}}
]{topmargin}
\DeclareNewLayer[
background,
bottommargin,
mode=picture,
contents=\putLL{\includegraphics[width=\layerwidth,height=2.5cm]{example-image-B}}
]{bottommargin}
\AddLayersToPageStyle{@everystyle@}{topmargin,bottommargin}
\clearpairofpagestyles
\cfoot*{\pagemark}% page number centred in footer
\chead{\headmark}% section entry centred in header
\ihead{inner}
\ohead{outer}
\usepackage{blindtext}
\begin{document}
\Blinddocument
\end{document}