[Bugs] #3413 UNSP: Read: number of pages in epub books can change
Sugar Labs Bugs
bugtracker-noreply at sugarlabs.org
Fri Mar 30 14:51:00 EDT 2012
#3413: Read: number of pages in epub books can change
------------------------------------------+---------------------------------
Reporter: godiard | Owner: godiard
Type: defect | Status: new
Priority: Unspecified by Maintainer | Milestone: 0.96
Component: Read | Version: Unspecified
Severity: Unspecified | Keywords:
Distribution: Unspecified | Status_field: Unconfirmed
------------------------------------------+---------------------------------
The epub files do not have information aboout pages, because the
information is stored in files by chapters, and as a continuum html text.
The epub backend in the Read activity use a webkit widget to load the html
file, and execute a javascript to calulate the document height, and based
on this value, calculate the number of pages. The problem we have is,
running this javascript code return different values at times. We use this
value to calculate the position needed to scroll to position the document
when the activity start at the same position the reader left the last
session. Also based inthe scroll position, we update the toolbar widget
with the page number, and show the bookmarks related to the page.
I researched how other book readers calculate the pages, and there are not
a uniform solution.
* readers using the Adobe code to display calculate the number of pages
based in the size of the chapter file. [1] and [2]
* fbreader use the library ZLibrary to calculate the number of pages [3]
but this number are not related with the size in the webview, then are not
useful for us without change a lot our code.
* Other epub readers use css and javascript to paginate the text,
but this does not resolve for us how to update the information in our
toolbar. [4] [5]
I have tried modifying the javascript code, but the returned values
continue being different
[1] http://bookclubs.barnesandnoble.com/t5/NOOK-Book-Discussion/EPUBs-and-
page-numbering/td-p/691602
[2] http://www.mobileread.com/forums/archive/index.php/t-166173.html
[3] http://stackoverflow.com/questions/6027477/how-the-fbreader-do-the-
pagination-of-html-files-in-epub
[4] http://stackoverflow.com/questions/2808652/how-to-implement-page-
break-in-epub-reader
[5] http://stackoverflow.com/questions/3636052/html-book-like-
pagination?tab=active#tab-top
--
Ticket URL: <http://bugs.sugarlabs.org/ticket/3413>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list