There is an alternative (and pretty modern) package for headers and footers (and more) called scrlayer-scrpage. In the documentation is an exapmple for yellow headers, i changed it to gray footers. Package showframe was just added for demonstration.
This works for twosided documents as well.
Code: Select all
\documentclass[10pt,a4paper]{article}
\usepackage{showframe}
%\usepackage{fancyhdr}
\usepackage[automark,footsepline]{scrlayer-scrpage}
\usepackage{geometry}
\geometry{
a4paper,
left=25mm,
right=15mm,
top=40mm,
headheight=30mm,
bottom=20mm,}
%\pagestyle{fancy}
%\fancyhf{}
% % fotter
%\renewcommand{\footrulewidth}{0.4pt}
%\fancyfoot[L]{ some image will \\ be here}
%\fancyfoot[R]{\thepage}
\clearscrheadfoot
\ifoot{\rule{2em}{2em}}
\ofoot{\pagemark}
\usepackage{xcolor}
\usepackage{blindtext}
\DeclareLayer[clone=scrheadings.foot.oneside,
contents={%
\color{lightgray}%
\rule[-\dp\strutbox]%
{\layerwidth}{\layerheight}%
}%
]{scrheadings.foot.oneside.background}
\DeclareLayer[clone=scrheadings.foot.odd,
contents={%
\color{lightgray}%
\rule[-\dp\strutbox]%
{\layerwidth}{\layerheight}%
}%
]{scrheadings.foot.odd.background}
\DeclareLayer[clone=scrheadings.foot.even,
contents={%
\color{lightgray}%
\rule[-\dp\strutbox]%
{\layerwidth}{\layerheight}%
}%
]{scrheadings.foot.even.background}
\AddLayersAtBeginOfPageStyle{scrheadings}{%
scrheadings.foot.oneside.background,%
scrheadings.foot.odd.background,%
scrheadings.foot.even.background%
}
\pagestyle{scrheadings}
\setlength{\footheight}{24pt}%
%JB: the package tells us the exact height, which is 23.60007pt
\begin{document}
test
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.