Open benjaminpick opened 5 years ago
The book (epub
here) has a request
object that you can pass to item.load()
which is aware of your context, either loading from the HTTP path where the book was found, or the data blob. I believe that should help you out here.
Providing this.book.load.bind(this.book) as the argument to item.load did the job for me:
this.book.loaded.spine.then((spine) => {
spine.each((item) => {
item.load(this.book.load.bind(this.book)).then((contents) => {
console.log(contents);
});
});
});
Hi,
similar to #659 I need to generate a Table of Contents based on the HTML that is inside the sections. However, book.spine.each() only returns the sections without the contents property (except for the current section). Is there a method to load all sections?
The example code
results in 404 errors (localhost/OEBPS/section.xhtml) as I am passing the epub as data blob.
EDIT: I could use
to access to those files. Does epub.js currently only unzip the current section?