Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems on get current bookmark data #388

Open
paulocoutinhox opened this issue May 24, 2017 · 5 comments
Open

Problems on get current bookmark data #388

paulocoutinhox opened this issue May 24, 2017 · 5 comments

Comments

@paulocoutinhox
Copy link

Problems on get current bookmark data

Some epubs are returning null on contentCFI when calling function:
"ReadiumSDK.reader.bookmarkCurrentPage()"

The ebook is:
https://www.dropbox.com/s/mdoa9w7v3cpqd25/ecologia-urbana.epub?dl=0

To get problem, go to chapter "cidade e não cidade" and try call the function on this page.

@paulocoutinhox
Copy link
Author

On first page:

["idref": c_d1e8383, "contentCFI": /4/2/2[p0001-01]/2[p0001-01-0]/4,/1:0,/1:1]

On that page:

["idref": c_d1e243, "contentCFI": <null>]

@danielweck
Copy link
Member

Mhmm, I am "kinda" able to reproduce this on Safari OSX.
Open the web/cloud reader: https://readium.firebaseapp.com
...and drag+drop ecologia-urbana.epub (10MB zipped EPUB container, but loads okay on my computer).
Click on the "shared reader bookmark" button in the toolbar (chain link icon), the console reports correct reader.getFirstVisibleCfi() (idref: "c_d1e243", contentCFI: "/4/2/16[p0016-02]/2[p0016-02-1],/1:414,/1:415") but failed reader.getLastVisibleCfi() (idref: "c_d1e243", contentCFI: "/4/NaN/NaN/NaN")

@danielweck
Copy link
Member

So, if I invoke JSON.parse(ReadiumSDK.reader.bookmarkCurrentPage()) in the web browser's console, I get a valid bookmark: idref: "c_d1e243", contentCFI: "/4/2/16[p0016-02]/2[p0016-02-1],/1:414,/1:415". That is because the bookmark is in fact reader.getFirstVisibleCfi().

@paulocoutinhox
Copy link
Author

But it is a problem on JS sdk or i need make something different?

@danielweck
Copy link
Member

It looks like a bug, but I am not able to pin-point where the CFI "navigation logic" fails. CC @jccr any ideas? Sometimes reader.getFirstVisibleCfi() fails, sometimes reader.getLastVisibleCfi()... there must be some HTML markup in this EPUB chapter that screws-up the CFI / DOMRange / Client-Rectangles calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants