Do you mean physical dimensions of the page? If yes, I had a talk about it at TUG'11. Our paper is in the upcoming TUGboat, but the talk itself is here: http://river-valley.tv/ebooks-and-paper-size-output-routine-hacking-made-easy/
There are snippets of code on the screen; if you are interested, let me know, and I put copies of them here.
Update: here is LaTeX example that shows the idea:
\documentclass{article}
\usepackage{everyshi,lipsum}
\pagestyle{empty}
\textheight500cm
\EveryShipout{%
\pdfpageheight=\pagetotal
\advance\pdfpageheight by 2in
\advance\pdfpageheight by 2\topmargin
\advance\pdfpageheight by \textheight
\advance\pdfpageheight by -\pagegoal}
\begin{document}
\lipsum[3-5]
\pagebreak
This line has a footnote\footnote{\lipsum[6-8]}.
\lipsum[1]
And this line too\footnote{\lipsum[12]}.
\pagebreak
\end{document}