Showing all search results

49 views
Skip to first unread message

Alistair Jackman

unread,
Dec 13, 2013, 7:45:40 AM12/13/13
to pdfnet-w...@googlegroups.com
The behaviour of the search (in the side panel) seems to be to show just one result, until the search is triggered again, when remaining search results are shown.

How can I set the default behaviour to be to show all search results on that initial triggering of search?

Thanks
A

Matt Parizeau

unread,
Dec 13, 2013, 2:57:42 PM12/13/13
to pdfnet-w...@googlegroups.com
Hi Alistair,

I've looked into it and found what seems to be causing the problem.  Basically the search is being cancelled when the page or display mode changes and the behavior of the search on the side panel is to jump to the page of the first result.  So if you happen to be on the page of the first result then everything will be fine and all the search results will appear in the panel but if you're not on the page of the first result then you'll jump there and the search will be cancelled after getting the remaining results on that page.

So one way to fix the problem of all the results not showing is to modify ReaderControl.js so that you don't jump to the first result.  You could do this by modifying the fullTextSearch function and removes the lines:
if (searchResultLineId === 1) {
    $resultLine
.click();
}

However this still means the search will stop if the document is large and you're scrolling through as the results come in.  So I removed the cancelling of searches when changing pages and you can try out the change in this build: http://pdftron.com/ID-zJWLuhTffd3c/WebViewer/WebViewer_1.6.1.22298.zip

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Alistair Jackman

unread,
Jan 16, 2014, 6:49:44 AM1/16/14
to pdfnet-w...@googlegroups.com
Thanks Matt!
Reply all
Reply to author
Forward
0 new messages