View Single Post
Old 03-21-2025, 10:20 PM   #21
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,125
Karma: 169815798
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
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

Last edited by DNSB; 03-21-2025 at 10:24 PM.
DNSB is offline   Reply With Quote