Search results text highlighting only

Pdfjs.express Viewer version

Issue description
We trying to highlight search results in viewer using textSearchInit method:

const searchMode = instance.Core.Search.Mode.PAGE_STOP | instance.Core.Search.Mode.HIGHLIGHT;
documentViewer.textSearchInit(phrase, searchMode, {fullSearch: true});

And unfortunately we did not saw expected behavior.

We also tried to highlight search results in viewer using searchTextFull:

instance.UI.searchTextFull("some")

And it’s working as expected, but it also displays search sidebar, which we would like to hide and make our own instead.

The question

Is this possible to highlight text in viewer only, without displaying search sidebar?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi Apetrov,

The work around for this issue would be to just hide the panel as soon as the search is performed.

e.g.

instance.UI.searchTextFull('some')
instance.UI.closeElements([ 'searchPanel' ]);

Hopefully this works for you.

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here