Which product are you using?
PDF.js Express Viewer
PDF.js Express Version
8.7.4
Detailed description of issue
Searching on PDF is not working on some pdf. It is tested on small file size, large file size and Pages are like 6 and 465±40.
Expected behaviour
Show the result of search on every file.
Does your issue happen with every document, or just one?
Some Document
Link to document
Clean Code “Robert Cecil Martin”
Code snippet
import WebViewer from ‘@pdftron/pdfjs-express’
window.pdfViewerInit = function (element) {
let file = element.getAttribute(‘src’);
const url = new URL(file);
WebViewer({
path: ‘/public’, // point to where the files you copied are served from
disabledElements: url.searchParams.get(‘download’) == “true” ? : [
‘downloadButton’,
‘printButton’,
‘printModal’
],
initialDoc: file
}, element).then((instance) => {
const { documentViewer } = instance.Core;
// search can only be performed after a document is loaded
documentViewer.addEventListener('documentLoaded', () => {
})
})
}