Custom search in the notes panel

WebViewer Version:

Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? No
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? Yes

Please give a brief summary of your issue:
(Think of this as an email subject)
Enhance the search capability in the notes panel

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

We have recently implemented some customizations to create custom annotation and display some additional text in the notes panel for those custom annotations. We are storing the additional text in the XFDF in trn-custom-data by using annotation.setCustomData. (the custom text is shown in the screenshot and is in italics).

That part is working correctly.
Now, we would like the “Search Comments” input at the top of the notes panel to include this custom text when searching.

Is there a way to do that?

Or, as an alternative, is there a way to save and display style information in the preview text that normally accompanies a highlight annotation (saved in trn-custom-data → trn-annot-preview)? That text seems to be searchable. If we could style that portion of text, we could save it to the trn-annot-preview XFDF data.
Our custom annotation currently sets the trn-annot-preview data, but my attempts to save style information within that text have failed.

1 Like

I am sending this over to the WebViewer Team. They should be in contact shortly.

2 Likes

Hello william.kicinski,

You will have to adjust the search algorithm’s behaviour, we have a guide on that here: Apryse Documentation | Documentation

Let me know if you have any additional questions!

Best regards,
Tyler

1 Like

Hi Tyler,
Is there a way to control the search that happens in the comments panel itself? When I tried the example, it is searching the text in the document. I would like to search in the comments panel and include the preview text, comments, replies (that it already does now) as well as including some additional text that I have added into the XFDF.

1 Like

Hello william.kicinski,

We have the overrideSearchExecution API here: Apryse WebViewer Namespace: UI

You can pass in whatever logic you want into the callback.

Best regards,
Tyler

1 Like

Hi Tyler,
I am just getting back to this. I tried using overrideSearchFunction. The function is only getting called when I use the search that is activated by the magnifying glass here:

I need to hook into the search when viewing the comments panel:

Is there a way to do that?
Thanks,
Bill

1 Like

Hello william.kicinski,

Apologies for sending the wrong search API, it looks like we dont have a way to insert a custom search function for the notes, so Ill add this as a feature request.

You do have a couple options in the meantime:

Best regards,
Tyler

1 Like

Tyler,
Thanks for the information. I will look into the two methods that you mentioned.

Bill

1 Like