Add logging for page changes and total pages in PSPDFKit
Added a .then() handler to loadPSPDFKit to log the active page number on page change events and log the total number of pages after loading. This aids in debugging and tracking user navigation within the document.
This commit is contained in:
@@ -16,7 +16,16 @@
|
||||
isEditableAnnotation: function (annotation) {
|
||||
return !(annotation.isSignature || annotation.description === 'FRAME')
|
||||
},
|
||||
});
|
||||
}).then((instance) => {
|
||||
instance.addEventListener('viewState.currentPageIndex.change', (pageIndex) => {
|
||||
console.log('Active page:', pageIndex + 1)
|
||||
})
|
||||
|
||||
const totalPages = instance.totalPageCount || 0
|
||||
console.log('All pages loaded, total pages:', totalPages)
|
||||
|
||||
return instance
|
||||
})
|
||||
}
|
||||
|
||||
const allowedToolbarItems = [
|
||||
|
||||
Reference in New Issue
Block a user