Search not highlighing every word

142 views
Skip to first unread message

Volker Andres

unread,
Jun 8, 2017, 11:51:33 AM6/8/17
to PDFTron WebViewer
Hi,

We have a little problem with the search. Sometimes words get highlighted, sometimes not. They are more or less at the same position at different pages. See the screenshots. We use the default search which comes with MobileReaderControl.js:

searchText: function (pattern, searchUp) {

    var pageResults = [];

    var me = this;
    if (pattern !== '') {
        var mode = me.docViewer.SearchMode.e_page_stop | me.docViewer.SearchMode.e_highlight;
        if (searchUp) {
            mode = mode | me.docViewer.SearchMode.e_search_up;
        }

        me.docViewer.textSearchInit(pattern, mode, false,
            // onSearchCallback
            function (result) {
                if (result.resultCode === Text.ResultCode.e_found) {
                    pageResults.push(result.page_num);

                    me.docViewer.displaySearchResult(result, _(me.jumpToFound).bind(me));
                } else if (result.resultCode === Text.ResultCode.e_done) {
                    alert(i18n.t("endOfDocument"));
                }
            });
    }
},
.

When I debug "result", the quads is an empty array for the not working terms.

Best Regards,
Volker
Bildschirmfoto 2017-06-08 um 14.33.02.png
Bildschirmfoto 2017-06-08 um 14.33.28.png

Justin Jung

unread,
Jun 9, 2017, 7:32:24 PM6/9/17
to PDFTron WebViewer on behalf of Volker Andres
Hello Volker,

We are having trouble reproducing the issue. Could you send us the document?

Justin Jung
Software Developer
PDFTron Systems Inc.

Volker Andres

unread,
Jun 12, 2017, 4:07:47 PM6/12/17
to PDFTron WebViewer
Find the document here https://www.mympa.ch/search.xod

Justin Jung

unread,
Jun 13, 2017, 8:03:38 PM6/13/17
to PDFTron WebViewer on behalf of Volker Andres
We are still having trouble reproducing issue. We've tried searching the term 'lautsprecher' in mobile viewer, and the terms were highlighted.
Could you provide us specific steps that reproduce the error constantly? Also, can you reproduce the issue in uncustomized WebViewer?

Volker Andres

unread,
Jun 14, 2017, 12:38:24 PM6/14/17
to PDFTron WebViewer
Hi,

I am able to reproduce it also with the default mobile webviewer 2.2.2. Tested it with most current Chrome and Firefox on a MacOS Sierra. We have updated the search.xod so that even the pdftron.com watermark is removed.
Bildschirmfoto 2017-06-14 um 08.44.09.png
Bildschirmfoto 2017-06-14 um 08.44.29.png

Justin Jung

unread,
Jun 14, 2017, 7:33:02 PM6/14/17
to PDFTron WebViewer on behalf of Volker Andres
Thanks for the info. We were able to reproduce the error in 2.2.2; however, we couldn't reproduce it in version 3.0.
There were several text selection issues that were fixed for 3.0, and it seems like this issue is one of them.

Volker Andres

unread,
Jun 15, 2017, 8:58:03 AM6/15/17
to PDFTron WebViewer
What do I have to do, to update to 3.0? We edited the MobileReader massively, so is it enough to update the Core-Files? Could you pls give us a list, which files/directories to update?

Justin Jung

unread,
Jun 16, 2017, 8:03:40 PM6/16/17
to PDFTron WebViewer on behalf of Volker Andres
As noted in "What's New" (http://www.pdftron.com/webviewer/demo/whatsnew.html), now an instance of AnnotationManager is created only once. This means that listeners should only be set once, or they will cause problems when you load multiple documents in the same viewer. If you don't load multiple documents in the same viewer, it should be fine.

Other than that, you will need to update the other files in the html5 folder.

Volker Andres

unread,
Jun 19, 2017, 1:08:53 PM6/19/17
to PDFTron WebViewer
I think you can delete my last answer, I got 95% to run now. One new thing still occurs. If I enable TextSelect, it is only active when hovering over the text. Can I disable this and enable the 2.2.2 behaviour?

Justin Jung

unread,
Jun 21, 2017, 7:06:05 PM6/21/17
to PDFTron WebViewer on behalf of Volker Andres
Hello,

You can use the following build http://www.pdftron.com/ID-zJWLuhTffd3c/WebViewer/WebViewer_3.0.0.61373.zip (you can only update CoreControls.js)

and disable to auto-switching by adding the following line in config.js:

Tools.Tool.ENABLE_AUTO_SWITCH = false;

Volker Andres

unread,
Jun 22, 2017, 11:52:55 AM6/22/17
to PDFTron WebViewer
Thank you, it works.
Reply all
Reply to author
Forward
0 new messages