And I still say that if you want page numbers for an ebook, go with a page oriented format which means PDF.
As I said, I did modify an ePub for one person. It took a bit of work since he was not happy with having the page number displayed centered on a page since it looked fugly and could be widowed or orphaned. The next step was adding a page break before the page number so the page number was always at the top of a page but that ran into issues with his ereader having issues with the break-before/page-break-before in the CSS stylesheet.
Basically, I grabbed the span that IDed the page and modified it to display the page number centered on the page using a bit of regex to grab the paragraphs starting and ending code, the words before and after the existing span and the page number from the title. Quick and dirty and some cleanup was needed.
Code:
all <span epub:type="pagebreak" id="page_87" title="87"></span>you
Code:
all </p>
<p class="center bold"><span epub:type="pagebreak" id="page_87" title="87"></span>87</p>
<p class="para>you