epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

Render all section of book

Open yarnie046 opened this issue 2 years ago • 6 comments

I really want to find a solution to render all sections of the book. Can you give me some way?

yarnie046 avatar Aug 25 '23 10:08 yarnie046

Anyone hereeeeeee

yarnie046 avatar Aug 25 '23 10:08 yarnie046

Loop through the sections (using e.g. book.spine.each()) and call section.render() to get the HTML.

johnfactotum avatar Aug 25 '23 11:08 johnfactotum

@johnfactotum uhm, my idea is rendering all the sections. After that base on location calculate the total page. Is it Is it possible or not? My goal is to calculate totalpage.

yarnie046 avatar Aug 26 '23 05:08 yarnie046

Yeah, if you only want to calculate the number of pages, you just render each section and add up location.start.displayed.total.

johnfactotum avatar Aug 26 '23 10:08 johnfactotum

@johnfactotum Thanks for your answers. I did this. It's working nicely in a book with the book separated into multiple sections. And each section has a page count of less than 50 pages. And it is very slow for books with content each section is about 500 pages large. Is there a way to optimize the calculated total number and render section time?

yarnie046 avatar Aug 28 '23 03:08 yarnie046

AFAIK, not possible.

johnfactotum avatar Aug 31 '23 10:08 johnfactotum