# How to make footer stick close to the text on the last page?

I want footer to appear immediately after text on the last page, without huge gap. I used showframe package and know that white space comes from the body (is tex adding some sort of \vskip or similar so that body height is exactly \textheight?). I'm also able to shift footer manually by decreasing \textheight for the last page using changepage package:

\changepage{-10cm}{}{}{}{}{}{}{}{}


But I need some way to get "true" text height automatically to substitute it as an argument for changepage.

And of course there could be (should be!) some better and cleaner way to solve this problem.

-
Maybe this question offers some help: Footnotes on bottom except on last page of a chapter – Alan Munn Aug 30 '11 at 15:26
This is a rather uncommon layout. Unless you are required to move the footer because of some state/university style rules, I'd advise against it. – lockstep Sep 1 '11 at 15:19
Well, not strictly state rules, but since footer contains \hrules for signatures (every page should be signed), it should be close to the body so that nothing could be hand-written between. – one_half_3544 Sep 2 '11 at 7:32

Possible solution is to move footer contents to the body of the document for the last page:

....
\newcommand{\footercontents}{my footer text}
\tcfoot{\footercontents}
\pagestyle{fancy}
....
%last page
\nopagebreak[4]
\thispagestyle{plain}
\footercontents
\end{document}


The obvious problem with this solution is ensuring that footer does not hang alone on the last page, i.e. there is no page break between normal text and \footercontents. Neither \nopagebreak (even with maximum argument) nor samepage environment works for me =(

-