Guides
Page Navigation
After loading and displaying a PDF document in the CPDFViewer, users can navigate to different pages.
This example shows how to navigate to specific pages:
java
// Navigate to the first page.
readerView.setDisplayPageIndex(0);1
2
2
Get the Current Page Index
java
int pageIndex = readerView.getPageNum();1
Listen for Current Page Changes
java
readerView.setReaderViewCallback(new IReaderViewCallback() {
@Override
public void onTapMainDocArea() {
// Tap on the main document area
}
@Override
public void onMoveToChild(int pageIndex) {
// Currently displayed page index
}
@Override
public void onEndScroll() {
// Scrolling ended
}
@Override
public void onScrolling() {
// Scrolling in progress
}
@Override
public void onRecordLastJumpPageNum(int pageIndex) {
// Record the last jumped page index
}
});1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
kotlin
readerView.setReaderViewCallback(object : IReaderViewCallback {
override fun onTapMainDocArea() {
// Tap on the main document area
}
override fun onMoveToChild(pageIndex: Int) {
// Currently displayed page index
}
override fun onEndScroll() {
// Scrolling ended
}
override fun onScrolling() {
// Scrolling in progress
}
override fun onRecordLastJumpPageNum(pageIndex: Int) {
// Record the last jumped page index
}
})1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22