Which product are you using?
PDF.js Express Viewer
PDF.js Express Version
8.7.4
Detailed description of issue
I am implementing a feature to display pages side by side. I have successfully added next and previous buttons for navigation in the normal view, allowing users to navigate two pages at a time. However, when in full-screen mode, I am unable to display these custom buttons in the same manner as the library’s default buttons, which appear at the bottom center. I also attempted to capture the events of the existing library’s previous/next buttons without success. Could you provide any suggestions on how to resolve this issue?
Expected behaviour
Users should be able to navigate two pages at a time using the previous and next buttons in full screen mode.
Does your issue happen with every document, or just one?
This issue occurs only when a document is opened in full-screen mode.
Code snippet
navigateToNextPage = () => {
const totalPages = this.documentViewer.getPageCount();
const currentPage = this.documentViewer.getCurrentPage();
if (currentPage < totalPages) {
const nextPage = Math.min(currentPage + 2, totalPages);
this.documentViewer.setCurrentPage(nextPage);
this.updatePageNumber();
}
};
navigateToPreviousPage = () => {
const currentPage = this.documentViewer.getCurrentPage();
const previousPage = Math.max(currentPage - 2, 1);
if (currentPage > 1) {
this.documentViewer.setCurrentPage(previousPage);
this.updatePageNumber();
}
};