-
Notifications
You must be signed in to change notification settings - Fork 106
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
How to render certain spine document under specific DIV? #192
Comments
Personally if I had to implement this functionality, I would start by creating a totally new type of "view". Currently:
Note that both "fixed" and "scroll" view wrap multiple instances of "one page view" to actually embed iframes, see https://github.com/readium/readium-shared-js/blob/develop/js/views/one_page_view.js The bottom line is: you must leverage Readium's "iframe loader" infrastructure ( https://github.com/readium/readium-shared-js/blob/develop/js/views/iframe_loader.js ) to handle document loading / caching, etc. If you bypass this by creating your own iframes, you will essentially break a number of critical reading system features. I hope this helps! |
@danielweck Thank you very much, Daneil. It sure helps a lot. |
@danielweck Hi, sir, please help. I have tried to read the code you mentioned above, but it really hard to figure out how they work step by step, since there isn't too much comments. Could you please give me more hints? Which code snippets should I study if I want a function like this:
The first parameter is spineIndex or spineHref that indicates which spine I want to show. In fact, I don't really mind the control part of the iframe, such as getCfi, or openNextPage. Please help, sir. |
I am afraid I cannot help with your use-case (beyond my initial suggestions), as this diverges too much from how a traditional reading system lays out publication pages / documents. As I said, you would need to write a new type of "view" in order to achieve your desired layout. You cannot simply take arbitrary documents from the linear reading order (spine), and push them into arbitrary iframes, as this is normally the responsibility of the reading system (to present / render the publication in its linear reading order, along the spine "axis"). |
Hi, I am working on a project that needs to render more than one chapter on different areas.
Maybe look like this:
I have tried to COPY the iframe that already rendered using Readium and PASTE them to the DIV like this:
This approach works for a normal iframe which loads content from a real url such as www.google.com, but failed in Readium' case. I have noticed that , the src of iframe is something like this:
This special src value only work at the first time, if you try to load it again, the following error will occur. I found this src value changes everytime. I guess COPY and PASTE approach is not going to work.
So, right now I am trying to find out how to render a certain spine document, inside an iframe, under a designated DIV, not automatically by Readium. Is this possible? Or where can I found the code snippets that I can stduy with?
Please help. Thank you very much.
BTW, using multiple Readium instance is not acceptable right now. And, using back end to host the ebook, which I know should be working, is also unacceptable at this moment.
The text was updated successfully, but these errors were encountered: