readium/readium-js

is there a way to access all the spine items without loading each of them to iframe?

hz0324 opened this issue · 1 comments

I am trying to build a pagination system.

theoretically, I can iterate all the spine item and compute the width of the body inside the iframe and then calculate how many pages one spine item has. But in reality, the fresh state of the browser tab is really annoying. Whenever a iframe is loaded to the page, the browser will refresh the favicon in the browser tab.

Now, I am dong it like this:
in side the window.ReadiumSDK.Events.CONTENT_DOCUMENT_LOADED event
if (!spineItem.spine.isLastItem()) { var nextSpineItem = spineItem.spine.nextItem(spineItem); this.readium.reader.openSpineItemPage(nextSpineItem.idref, 0);

I wonder whether I can access to all the spine items without rendering them to the iframe one after another. Or, whether I can render them to cerntain DIVs all at once, and then iterate the iframes that already rendered. Either way it can aviods loading the iframe again and again, trigering the refresh state of the browser again and again.

I even tried to render the book to a detached element node, but failed. I guess it is impossible due to the way readium works.

Please help, thanks.

I suppose the answer to this issue: #174
...applies here too.
But, this in itself doesn't solve the problem of calculating / estimating the total number of pages in a reflowable publication (which of course varies depending on user-selected font size, etc.).
I am afraid there is no off-the-shelf support for this in ReadiumJS (or ReadiumSDK).