Current page, page count and the ways to move between them.
Re-renders when the current page changes (as the user scrolls) and when a document is loaded or its pages are rearranged.
The current pdf navigation state and actions.
const { currentPageNumber, pageCount, goToNextPage, canGoNext } = usePdfNavigation();return ( <> <span>{currentPageNumber} / {pageCount}</span> <button onClick={() => goToNextPage(200)} disabled={!canGoNext}>Next</button> </>); Copy
const { currentPageNumber, pageCount, goToNextPage, canGoNext } = usePdfNavigation();return ( <> <span>{currentPageNumber} / {pageCount}</span> <button onClick={() => goToNextPage(200)} disabled={!canGoNext}>Next</button> </>);
Current page, page count and the ways to move between them.
Re-renders when the current page changes (as the user scrolls) and when a document is loaded or its pages are rearranged.