flaviusmatis / flaviusmatis/simplePagination.js

How to move to previous and next page of PDF document

Open
#154 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
777
Forks
397
PR merge metrics
No merged PRs in 30d

Description

Good Morning Team

I am new in SimplePagination.js, trying to implement changes to NEXT and PREV buttons to move to another page.

Currently generated the list of pages inside pagination widget (dynamically based on PDF pages count)

var setPagination = function setPagination(data)
{
var totalDocPages = $('#pagesCount').val(); // get total pages of PDF

$("#pagination-holder").pagination({
items: data.documents,
itemsOnPage: 1,
currentPage: 1,
pages: totalDocPages,
selectOnClick: true,
cssStyle: 'light-theme',
prevText: '<<<',
nextText: '>>>',
onPageClick: updateRecIdx
});
}



{pagination}


But when I press the NEXT or PREV buttons the PDF displayed page is not changed. PDF going to rerender but displayed page is always first page.

Could You please help me how to move to next or previous page when click default buttons?

Adam

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with setPagination and the onPageClick: updateRecIdx callback, then trace how the selected page reaches the PDF renderer. Check the callback and the PDF integration for why navigation rerenders the document at page one. Done means the default NEXT and PREV controls display the adjacent PDF page.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.