Searching Across line breaks

We have integrated the viewer and are using the custom Triggers to search. Unfortunately, we can NOT find results where the provided string breaks to the next line.


Is there a line break character we can use or any work-around for that?

Hello Tim,

Thank you for your inquiry.

Try to use this code:

$(document).ready(function () {
    var containerElement = $("#Document");
    containerElement.groupdocsViewer("on", "documentLoadCompleted.groupdocs",
        function ( e ) {
            containerElement.groupdocsViewer("searchForward", 'solve the same', false, false, false);
        });
});

Where #Document is ID of the Viewer widget “div” tag.

As you can see on a screenshot, this code will find the results where the provided string breaks to the next line.

If you have more questions, please feel free to contact us.


Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs

Follow us on LinkedIn, Twitter, Facebook and Google+

Hi


Unfortunately that fix did not work. The text is"This letter shall be construed by and governed in accordance with English law and the parties hereby agree to submit to the exclusive jurisdiction of the English courts"

But the search was not able to find it

Unfortunately I cannot see how to upload a file on this post


Hello,

To share with us your file, you can use any file storage providers (GoogleDrive, DropBox e.t.c) and share a link for the file, or you can send it by email support@groupdocs.com.

We will wait for your file and will be glad to help you .

---------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+

could you possibly share what the variables represent in:


documentContainer.groupdocsViewer(“searchForward”,"some text’,false, false, false);
Hello,

All parameters are described bellow :
1. text – a string to search for;
2. isCaseSensitive – a Boolean value which specifies if the search is case-sensitive;
3. searchForSeparateWords - a Boolean value; if true, the Viewer will search for any of the words specified in the text parameter. If false, the Viewer control will search for exact matches of the whole phrase specified in the text parameter.
4. treatPhrasesInDoubleQuotesAsExact - a Boolean value; if true, then if a search phrase is in double quotes, the Viewer will find a match only if words in the current document are in the same order as they are in the search phrase and each word is equal to each word of the search phrase. White spaces and separator characters are ignored.

-------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+

Hello,

We got your message and checked our last version (2.14.0) of the GroupDocs.Viewer for Java library with your document. In two modes the image and the html this phrase was found well as you can see on the screenshots. We have used this code:

$(document).ready(function () {
    var containerElement = $("#test");
    containerElement.groupdocsViewer("on", "documentLoadCompleted.groupdocs",
        function ( e ) {
            containerElement.groupdocsViewer("searchForward", 'This letter shall be construed by and governed in accordance with English law and the parties hereby Ltdree to submit to the exclusive jurisdiction of the English courts', false, false, false);
        });
});

Please recheck this code with your application; it seems that previously you had a mistake in this phrase. If your version of the Viewer library isn’t 2.14.0 then please upgrade it.

If you still have the issue, please share your application.properties file with us.

We will wait for your results.


Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs

Follow us on LinkedIn, Twitter, Facebook and Google+.

Hello Tim,

We have checked your application.properties file and can say that there are no errors and the code looks OK. We added the same configuration to our application.properties file and checked the demo sample again (after deleting all cached files). We still see that the search works well.

In your file we found a mistake in the phrase and fixed it. Then we corrected the script code and ran our sample again (after removing the cache of files) and can see that the search works well.

So please remove all cache from your application and try again.

Note: To use HTML rendering mode you should change the groupdocs.viewer.useHtmlBasedEngine parameter to "true".

If you encounter the same issue again, please prepare a simple demo project that reproduces the issue and share it with us.

We will wait for your results.


Best regards,

Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs

Follow us on LinkedIn, Twitter, Facebook and Google+

Evgen

We have now got the HTML version working and finding text across lines…but it has stopped jumping to the relevant page.

Questions:

what properties in application.properties must be set for jump to work when operating in HTML mode
Do we need to have loaded all pages upfront for the jump to work?

Many thanks

Kind regards

Tim Pullan

This message was posted using Email2Forum by evgen.efimov.
Hello Tim,

Yes, you should add this parameter - groupdocs.viewer.loadAllPagesOnSearch=true and disable groupdocs.viewer.useVirtualScrolling=false parameter. After these changes navigating true search results will work correctly.

If you will have more questions please feel free to contact us.

-------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+