Using LaTeX, I'm trying to fit into the header a minipage containing the page number above a logo. However,

1. The minipage is pushed out of the header into the head separation space;
2. The distance between the page number and the logo varies from page to page.

How do I get it right without using fancyhdr?

Here is the code:

\NeedsTeXFormat{LaTeX2e}[2001/06/01]
\ProvidesClass{blabla}[2012/01/22 v2.0.2 blabla class]
\RequirePackage{geometry}
\RequirePackage{graphicx}
\RequirePackage{float}
\AtEndOfClass{\pagestyle{blabla}}

\def\ps@blabla{
\begin{minipage}{\textwidth}
\vspace{8mm}
\begin{center}
Page \arabic{page}
\end{center}
\vspace{-6mm}
\begin{figure}[H]
\centering
\includegraphics[width=17mm]{logo.png}
\end{figure}
\end{minipage}}

\def\@oddfoot{
\begin{minipage}{\textwidth}
blabla
\end{minipage}}

\endinput

-
Why is fancyhdr not an option? – Werner May 30 '12 at 18:26

I don't see why using a complicated way, when fancyhdr can do it more easily:

\documentclass{article}
\usepackage{fancyhdr}

\usepackage{geometry}
\usepackage[demo]{graphicx}

\pagestyle{fancy}
\fancyhf{}
\begin{minipage}{\textwidth}
\vspace{8mm}
\centering
Page \arabic{page}\\[6pt]
\includegraphics[width=17mm,height=17mm]{logo.png}
\end{minipage}}

\fancyfoot[L]{\begin{minipage}{\textwidth}
blabla
\end{minipage}}

\usepackage{kantlipsum}

\begin{document}
\kant
\end{document}


The demo option to graphicx is just for avoiding to have the picture. Note that a figure environment is not necessary for using \includegraphics.

You can fix the height reserved for the header by not setting headheight and letting fancyhdr suggest the suitable value; for example, with this code fancyhdr tells that the height is 86.90962pt, so setting headheight=90pt will be sufficient.

-
Thank you for the valuable advice concerning the redundancy of a figure environment for using \includegraphics. It seems to me that in fancyhdr one can manage without minipages. – Christopher Jun 2 '12 at 15:23
@Christopher It should be pointed out that figure environments are not actually redundant to \includegraphics. @egreg's hint refers to your specific purpose being not a common use case for a float, which is what a figure defines. – dgs Jun 2 '12 at 16:54