Comments (4)
me too, can't figure out how to get current page
need a props type to show/hide page number
from epubjs-rn.
You can get the current page by passing a function to the onLocationChange
property.
It will return an object with the CFI, location in the book and the percentage complete.
from epubjs-rn.
Hi @fchasen ,
On the onLocationChange event, I only get (for example) this params:
end:{
cfi:"epubcfi(/6/6[chapter-1]!/4/2/122/1:2)",
displayed:{page: 5, totalPages: 6},
href:"chapter-1.xhtml",
index:2,
location:13,
percentage:1},
start:{
cfi:"epubcfi(/6/6[chapter-1]!/4/2/112/1:308)",
displayed:{page: 5, total: 6},
href:"chapter-1.xhtml",
index:2,
location:10,
percentage:0.7692307692307693}
How can I get the currentpage from the start field's CFI?
This futurepress/epub.js/wiki/Tips-and-Tricks talks about how to get the current page. Are you generate pagination for this purpose or is there any alternative to get the current page?
Thanks in advance.
from epubjs-rn.
Location is equivalent to a kindle / adobe page location, otherwise if you want the rendered paged you can use the displayed pages to show what page you are in for that chapter.
Generate pagination shouldn't be used on the client as it has to render the entire book.
from epubjs-rn.
Related Issues (20)
- Error when run on RN 0.62.2 HOT 7
- Loading forever on ios HOT 2
- Scrolling Too Quickly Causes Location Jumping HOT 1
- I have get menu(toc),but Loading forever on ios
- how to change fonts of epub
- TypeError: section.document.createRange is not a function
- Multiple call to ref.current.rendition.next() not working
- Element ref was specified as a string (framer) but no owner was set. HOT 3
- problem to show epub in release build android ! HOT 1
- some html tag not override in code HOT 1
- how can get rendition of book at first for highlight some text HOT 2
- how can search word ?
- Can we set the specific location HOT 2
- Selecting/scrolling to first page of chapter causing jump to end of chapter HOT 2
- Can I use this library to get text/images from the EPUB?
- Using epubjs-rn with expo project HOT 2
- Android Loading Forever HOT 1
- Still maintain? HOT 2
- How to get cfiRange of any word in epub book
- Highlighting quotes, custom select text menu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epubjs-rn.