WebViewer Version: 8.7.0
Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? Yes
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? No
Please give a brief summary of your issue:
Is it possible to customize the current text search algorithm?
Please describe your issue and provide steps to reproduce it:
In its current form, the search feature supports basic text search and regular expressions. For my use case, I would like to enhance it with a custom search algorithm, specifically by adding “fuzzy search” via fuse.js.
To be clear, I’m happy with the “text extraction” performed by webviewer. I would like to take its output, perform my own search algorithm on it, and return the results back to the webviewer UI.
I have found the following avenues, but they all seem to have severe downsides:
UI.overrideSearchExecution– unfortunately this is limited to search executed from the UI, and ignored when calling
searchText()programmatically (which is what I’d need, too)
Core.Document.loadPageText– this is used in the document-search sample app, but as far as I can tell it would not allow to provide the location of the search results within the document (which is what I’d need)
Core.PDFNet.TextSearch– this looks interesting, but I’m not sure this can be intercepted/reimplemented?
Would you have any pointers on how to integrate a custom search as seamless as possible?