[Athen] Macmillan publisher

Joseph Polizzotto jpolizzotto at htctu.net
Mon Apr 23 07:40:09 PDT 2018



> Does anyone know if there’s a way to easily add page numbers to an epub file?


Not sure if it qualifies as “easy”, but If the EPUB contains separate XHTML files for each page of the print book, you could try the following:

1. Open the EPUB in Sigil and rename the the XHTML files
- (check print equivalent to verify proper page order and that each XHTML file is equivalent to one page number)
- Select the XHTML files (beginning with the file containing page 1)
- Right Click > Rename
- Begin renaming at "page0001"
- (Sigil will automatically adjust the OPF document to reflect the new naming structure of the XHTML files)
2. Use Find and Replace to add Page Number markup to the XTHML files
- Select the XHTML files (e.g., page0001, page 0002 etc.)
- Use Regex Find and Replace
- Find what: <body>
- Replace: <body> \n <p><span epub:type=“pagebreak" role="doc-pagebreak" id="page-1">1</span></p>\n
- (Each XHTML file will now have a page number on the top)
3. Repeat Step 2 for each file, changing the value of the page number in the Replace text field
- Replace: <body> \n <p><span epub:type="pagebreak" role="doc-pagebreak" id="page-2">2</span></p>\n etc.
4. Copy and Paste the Page-List Nav (see attached document) into the NAV document
- (I have included the markup for up to 500 print pages in the Page-List NAV section, so just copy/ add what you need for your book)
- (Paste it at the end of the TOC NAV section)
5. Add the (print) source metadata to the OPF. E.g.,
<dc:source>urn:isbn:12345678</dc:source>

Notes:

- Step 3 is still time-consuming and could be eliminated possibly with a script, albeit you’d still need to know the naming convention of the XHTML files (hence, step 1 would still be necessary)
- Consider adding an ARIA-label to the page number markup for easier reading/ differentiation between page numbers and list numbers:
<p> <span epub:type="pagebreak" role="doc-pagebreak" id="page-1" title="page 1" aria-label="page 1">1</span></p>
- EPUB reading systems that support page list navigation:
- Vital Source Bookshelf
- Adobe Digital Editions
- Azardi Reader
- check EPUBTest.org for more information: http://epubtest.org/testsuite/epub3/feature/page-list-nav/

HTH,

Joseph



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman12.u.washington.edu/pipermail/athen-list/attachments/20180423/bab9407a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Page-List Nav.xhtml
Type: application/xhtml+xml
Size: 35813 bytes
Desc: not available
URL: <http://mailman12.u.washington.edu/pipermail/athen-list/attachments/20180423/bab9407a/attachment.xhtml>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman12.u.washington.edu/pipermail/athen-list/attachments/20180423/bab9407a/attachment-0001.html>


More information about the athen-list mailing list