How to get total page number? #337
Unanswered
smcha-dcodelab
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to retrieve the total number of pages before an EPUB file is fully loaded. However, I couldn’t find a suitable state or hook for this.
In the Reader component, I noticed that the onLocationChange={handleLocationChange} allows access to the currentLocation information.
I would like a guide on how to fetch the total value of the displayed property from the information of all sections.
`
const handleLocationChange = (
currentLocation: any,
) => {
console.log("currentLocation:", currentLocation);
};
`
currentLocation: { "atStart": true, "end": { "cfi": "epubcfi(/6/2!/4/1:3)", "displayed": { "page": 1, "total": 1 }, "href": "Text/cover.xhtml", "index": 0, "location": -1, "percentage": 0 }, "start": { "cfi": "epubcfi(/6/2!/4/1:0)", "displayed": { "page": 1, "total": 1 }, "href": "Text/cover.xhtml", "index": 0, "location": -1, "percentage": 0 } }
Beta Was this translation helpful? Give feedback.
All reactions